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.x | 2.1.x | 2.2.x | 2.3.x | 2.4.x | 2.5.x | 2.6.x | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.7.4 | 2.7.5 | 2.7.6 | 2.7.7 | 2.7.8 | 2.7.9 | 2.7.10 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
No | No | No | 1.3 | No | No | No | No | No | No | No | No | No | No | No | No | No | No. Soon? |
Readme
Requirejs for Symphony-CMS
Abstract
This simply adds Requirejs to your Symphony CMS backend.
Installation
in your smyphony root directory:
git submodule add git://github.com/iwyg/sym_requirejs extensions/sym_requirejs --recursive
Go to
System->Extensions
, selectrequire js
and chooseenable/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