Answer the question
In order to leave comments, you need to log in
Question about php objects?
Good day !
I would like to ask, I can’t understand - no matter where I look, I can’t find about the fact that in the arguments of the called function you can create a function or an object
, the code from cakephp will be given and here I just can’t understand what goes where and where.
I tried to find it and for a month now I can not find the necessary information for myself.
he creates on the go or calls?
Router::scope('/', function ($routes) {
$routes->connect('/', ['controller' => 'Articles', 'action' => 'index']);
});
Answer the question
In order to leave comments, you need to log in
the static method is called with the first parameter of the string type and the second parameter of the callable pseudotype. callable means that this value can be called as a function. the declaration of this function is given when calling, i.e. this most callable-value is initialized. inside the Router::scope static method, this value will be called as a function that takes one parameter and calls its connect(string, array) method
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question