https://github.com/cult-of-coders/quantum-framework-router
Based on Flow Router, this plugin allows you to easily create routes within Quantum Framework
https://github.com/cult-of-coders/quantum-framework-router
Last synced: about 1 month ago
JSON representation
Based on Flow Router, this plugin allows you to easily create routes within Quantum Framework
- Host: GitHub
- URL: https://github.com/cult-of-coders/quantum-framework-router
- Owner: cult-of-coders
- Created: 2016-05-26T07:46:16.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-31T09:41:55.000Z (almost 9 years ago)
- Last Synced: 2025-01-21T11:23:33.336Z (3 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Router Configuration
=======================
```
Q('route', {
'layoutTemplate': 'App_Layout', // these are the defaults values
'notFoundTemplate': 'App_NotFound', // these are the defaults values
'notAuthorizedTemplate': 'App_NotAuthorized' // these are the defaults values
})
```Create a template named after that name:
```
{{> Template.dynamic template=main}}
```
Define a route
======================
```
Q('route /homepage', {
name: 'home', // optional
allowedRoles: ['USER'] // optional, uses roles service from Quantum
template: 'App_Homepage',
layout: 'App_Layout' // optional it will default to the main one.
});
``````
Q('route /homepage', {
name: 'home', // optional
allowedRoles: ['USER'], // optional, uses roles service from Quantum
action(params, queryParams) {
BlazeLayout.render('customTemplate', {main: 'somethingThatDependsOnParams'})
}
});
```Define a group
======================
```
Q('route-group admin', {
extends: 'other-group', // it will inherit the configuration of the group
prefix: '/admin',
allowedRoles: ['ADMIN'], // allowedRoles always overrides parent (same applies to individual route config)
layout: 'Custom_Layout', // layout always overrides the parent
triggersEnter: [],
triggersExit: [],
routes: {
'/path/x': 'template',
'/path2': function() {},
'/path3': {
// custom config that is inherited from group
}
}
});Q('route-group admin.users', {
inherits: 'admin',
prefix: '/users',
routes: {
}
});
```