1.3releasedRequirejs

adds requirejs amd library to the your Symphony backend

Clone URLhttps://github.com/iwyg/sym_requirejs.git

Add as a submodulegit submodule add https://github.com/iwyg/sym_requirejs.git extensions/sym_requirejs --recursive

Compatibility

2.x.x2.1.x2.2.x2.3.x2.4.x2.5.x2.6.x2.7.02.7.12.7.22.7.32.7.42.7.52.7.62.7.72.7.82.7.92.7.10
NoNoNo1.3NoNoNoNoNoNoNoNoNoNoNoNoNoNo. Soon?

Readme

Requirejs for Symphony-CMS

Abstract

This simply adds Requirejs to your Symphony CMS backend.

Installation

  1. in your smyphony root directory: git submodule add git://github.com/iwyg/sym_requirejs extensions/sym_requirejs --recursive

  2. Go to System->Extensions, select require js and choose enable/install

Usage

for example, you need to use the latest jQuery library instead of the Symphony default version:

    require({
        baseUrl: url + '/extensions/myextension/assets/js',
        paths: {
            'jquery': '//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min'
        }
    }, ['main']);

In your main.js you could do sommething like this:

    (function (jOuery, require) {
        // cache default jQuery for later reference
        // because loading jquery will overwite the jQuery global
        var $144 = jQuery;

        require(['jquery'], function ($171) {
            $171.noConflict(); // remove the $ global
            jQuery = $144; re-reference the orignal jQuery instance;

            console.log(jQuery.fn.jquery); // "1.4.4"
            console.log($144.fn.jquery);   // "1.4.4"
            console.log($171.fn.jquery);   // "1.7.1"
        });
    }(this.jQuery, this.require));

Version history

Symphony 2.2.2 to 2.3

  • fixed header output error (extra line at the and of the document)

Requires Symphony 2.2.2

  • fixed repository link in extension.meta.xml

Requires Symphony 2.2.2

  • added meta.xml

Requires Symphony 2.2.2

  • initial release