dev-master
9999999-dev https://github.com/RWOverdijk/SxRequireJsA RequireJS module for Zend Framework 2.
The Requires
- php >=5.3.3
- zendframework/zendframework dev-master
zf2 zend framework 2 requirejs
A RequireJS module for Zend Framework 2.
Version 0.1.0 Created by Wesley Overdijk, (*1)
This is a simple RequireJS module for Zend Framework 2 (from here referred to as ZF2). It allows you to use RequireJs within ZF2 by setting up modules / paths and adding applications., (*2)
The recommended way to get this module working, is to add it to your composer.json
, and then doing a php composer.phar update
., (*3)
vendor
directory. (usually /path/to/application/vendor)
like this:cd my/project/dir/vendor git clone git://github.com/RWOverdijk/SxRequireJs.git
application.config.php
.SxRequireJs doesn't work out of the box. It has its own public
directory and therefore the RequireJS file will not be accessible. To get this working, there are a couple of things you can do., (*4)
Add an AliasMatch
to your vhost (recommended). Example:
AliasMatch ^/([a-zA-Z0-9]+)/(css|img|js)/(.*) /Path/To/Your/Application/module/$1/public/$2/$3
Note: This does require you to add a directory to your vhost to allow access outside of your DocumentRoot., (*5)
Copy the js in the public directory to your application's public directory., (*6)
Set up symbolic links to map the module's public dir to the application's public dir, (*7)
Write an .htaccess that allows access to module public directories, (*8)
You can find more information, the configuration options and some usage examples in the SxRequireJs wiki., (*9)
A RequireJS module for Zend Framework 2.
zf2 zend framework 2 requirejs