Find best page for url.
- Tutorials:
Members
-
static,constantns.router.URL_FIRST_SYMBOLstring
-
Первый символ урла. Если приложение работает на хешах, то его надо переопределить в #.
-
baseDirstring
-
Базовая часть урла, относительно которой строятся урлы. Без слэша на конце.
-
regexpsobject
-
Регулярные выражения для проверки типов параметров.
-
routesobject
-
Маршруты. Этот массив должен быть объявлен в проекте.
Methods
-
staticns.router.compile(route){object}
ns.router.js, line 367 -
Compile route.
Name Type Description route
string -
staticns.router.generateUrl(id, params){string}
ns.router.js, line 239 -
Name Type Description id
string Page (layout) name.
params
object Url generation params.
Returns:
url.
-
staticns.router.init()
ns.router.js, line 180 -
Inititialize ns.router, compiles defined routes.
-
staticns.router.url(url){string}
ns.router.js, line 230 -
Generate url.
Name Type Description url
string Relative url.
Returns:
url that takes into consideration baseDir.
Type Definitions
-
routeobject
-
Properties:
Name Type Description page
string Название layout.
params
object Параметры паршрута.