fos-routing
es6 library for client generate path from symfony2 routing
Installing
npm install fos-routing --save
Usage
To work with Symfony2, you need to generate a js or json file with paths with fos:js-routing
php bin/console fos:js-routing:dump --callback="module.exports = " --target="any_custom_path || web/dist/fos_js_routes_export.js"
The --target
parameter is made, for example, it can be any
Then, you should connect the newly created file in fos-routing
// myRouting.js// import library fos-rouging;// import file with routes data; // set dataRouting; // export library;
In the main project
// In the main project; console;
forRouting Methods
Method | Params | Description |
---|---|---|
setData |
data:Array | Set data |
generate |
1. routing_name : String 2.params :Object of params |
Generate routing by routing_name with params , return string |