Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fos-routing

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fos-routing

js routing for symfony 2.x

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34K
increased by8.27%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 16 Jan 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc