Author:
iwyg
Version:
1.0
Released:
8 February 2012
Category:
Other

Description

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.git extensions/requirejs --recursive

Go to System->Extensions, select requirejs 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));

Repository

https://github.com/iwyg/sym_requirejs

Discuss this Extension

Compatibility

2.7.10 Unsure
2.7.9 Unsure
2.7.8 Unsure
2.7.7 Unsure
2.7.6 Unsure
2.7.5 Unsure
2.7.4 Unsure
2.7.3 Unsure
2.7.2 Unsure
2.7.1 Unsure
2.7.0 Unsure
2.6.11 Unsure
2.6.10 Unsure
2.6.9 Unsure
2.6.8 Unsure
2.6.7 Unsure
2.6.6 Unsure
2.6.5 Unsure
2.6.4 Unsure
2.5.4 Unsure

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details