Socket
Socket
Sign inDemoInstall

fos-routing

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fos-routing

js routing for symfony 2.x


Version published
Weekly downloads
25K
increased by9.51%
Maintainers
1
Install size
92.1 kB
Created
Weekly downloads
 

Readme

Source

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 Routing from 'fos-routing';
// import file with routes data
import RoutingData from 'path_to_folder_when_generate_file_with_routing_data || /web/dist/fos_js_routes_export';

// set data
Routing.setData(RoutingData);

// export library
export default Routing;

In the main project

// In the main project
import Routing from 'path_to_myRouting.js';

console.log(Routing.generate('demo_path'));

forRouting Methods

MethodParamsDescription
setDatadata:ArraySet data
generate1. routing_name: String 2.params:Object of paramsGenerate routing by routing_name with params, return string

FAQs

Last updated on 16 Jan 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc