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

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -