Just download and put into your www directory. Requires mod_rewrite.
Global initialization here (init your database or session for example)
[
{
"when": "route/template",
"then": {
"init": [
"[Route.Specific Initialize]"
],
"output": "Simple value or node. It'll be result"
}
}
... other routes
]
otaku
,
otaku/{param:type}
,
otaku[/optional]
Parameter type can be string
or integer
. String means alphanumeric words delimited by hyphen:
string
,
another-string
Inspired by Blender nodes
Parameter passed in route: [Name]
. Parameter names always processed with lcfirst()
{
"@template": "Path.To.Template",
"var1": "value1",
"var2": "value2"
... other variables
}
Template path: /application/Path/To/Template.php
Template variables can be another template node, service node, string, number, boolean.
Service is just class having static method. Method names always processed with lcfirst()
{
"@service": "[Path.To.Class Method]",
"@params": [
"param1",
"[RouteParam]"
... other parameters
]
}
Class path: /application/Path/To/Class.php
Parameter can be another service node, template node, string, number, boolean.
Called class method doesn't know where its result will be used. It doesn't work with templates directly. It simplifies testing.
All your classes should be placed in /application
directory. Otherwise autoloader can't find them.