Download the PHP package paysera/fork-carpe-hora-ch-cms-expose-routing-plugin without Composer
On this page you can find all versions of the php package paysera/fork-carpe-hora-ch-cms-expose-routing-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download paysera/fork-carpe-hora-ch-cms-expose-routing-plugin
More information about paysera/fork-carpe-hora-ch-cms-expose-routing-plugin
Files in paysera/fork-carpe-hora-ch-cms-expose-routing-plugin
Package fork-carpe-hora-ch-cms-expose-routing-plugin
Short Description symfony 1 exposed routing
License
Homepage https://github.com/Carpe-Hora/chCmsExposeRoutingPlugin
Informations about the package fork-carpe-hora-ch-cms-expose-routing-plugin
chCmsExposeRoutingPlugin: expose your symfony routes to javascript
Goal
chCmsExposeRoutingPlugin is a symfony 1.(3|4) plugin used to expose routing definition to the client side.
if you use symfony2, have a look to FriendsOfSymfony/FOSJsRoutingBundle
Requirement
You need jquery to use this plugin. jQuery is not bundeled with this plugin, you have to include it yourself.
How does it work ?
Enable
First, enable the plugin in your project configuration:
Then enable chCmsExposeRouting in your application:
And finaly publish assets
you're done !
More conf
You can disable the script auto inclusion by adding the following in your routing.yml
You can disable the route auto declaration by adding the following in your routing.yml
and the register your route this way:
register your exposed routes
make a route exposable
the only thing you need to do is to add an _appexpose option:
force a route exposition
in your application config ( app.yml ), add the following:
expose all exposable routes
if you want to expose all routes with _appexpose option to true, just add the following to your application config ( app.yml ):
custom filter on exposed params
in your application config ( app.yml ), add the following:
access routes in browser
It's as simple as calling Routing.generate('route_id', /* your params */)
.
Documentation
- Javascript Documentation
- PHP Plugin Documentation
Test suite
You can help us improving code quality by running the JS Test Suite. if you find something wrong, please Report Isssue
TODO
- cache js routing
- add simple way to call server with sf_method and csrf_token