Becklyn/javascript-router


The JS implementation of Symfony's Router.

License: BSD-3-Clause

Language: JavaScript


Symfony JavaScript Router

This is a modern implementation of the JS router for generation Symfony routes. Best to be used with the JavaScript routing bundle.

Initialization

For example like this (using mojave):

import {initFromGlobalData} from "mojave/init"; 
import {Router} from "@becklyn/router";

let router = initFromGlobalData("RouterInit", new Router());

A manual way to wire it up to global data is like this:

function loadGlobalData (key, handler)
{
    if (undefined === window[key])
    {
        return;
    }

    // replace global callback
    window[key].init = (data) => handler.init(data);
    // handle current data
    handler.init(window[key].data);
}

let router = new Router();
loadGlobalData("RouterInit", router);

Project Statistics

Sourcerank 3
Repository Size 22.5 KB
Stars 0
Forks 0
Watchers 2
Open issues 0
Dependencies 4
Contributors 2
Tags 4
Created
Last updated
Last pushed

Top Contributors See all

Jannik Zschiesche Kai Eichinger

Packages Referencing this Repo

@becklyn/router
The JS implementation of Symfony's Router.
Latest release 1.0.3 - Updated

Recent Tags See all

1.0.3 December 10, 2019
1.0.2 October 22, 2019
1.0.1 August 05, 2019
1.0.0 July 31, 2019

Something wrong with this page? Make a suggestion

Last synced: 2019-12-10 15:59:02 UTC

Login to resync this repository