php - How do I pass arguments in a route when defined in ini files in fatfree framework? -
in fatfree framework, defining routes in ini files. like:
get|post /admin/login = controllers\siteadmin\login->index get|post /admin/login/@action = controllers\siteadmin\login->@action
now wondering how pass arguments functions in setup. how set cache , ttl values each route?
in .ini file, can pass arguments of route() method, separated commas:
get /foo=class->method //ttl=0, kbps=0 /foo=class->method,86400 //ttl=86400, kbps=0 /foo=class->method,0,56 //ttl=0, kbps=56
to pass arguments, use following syntax:
get /foo/@arg1/@arg2=myclass->mymethod
the method receive parameters 2nd argument:
class myclass { function mymethod($f3,$params) { echo $params['arg1']; echo $params['arg2']; } }
concerning cache, set globally, not each route:
[globals] cache=true
Comments
Post a Comment