I want to call an inline function defined in routes.php file.
I have tried these codes:
Router::connect('/test', function () { return 'test';exit;});
Router::connect('/test', function () { echo 'test';exit;});
but when I access localhost/cakephp/test I get error:
Error: Cannot use object of type Closure as array
File: /var/www/html/massmobile/lib/Cake/Routing/Router.php
Line: 348
Notice: If you want to customize this error message, create app/View/Errors/fatal_error.ctp
In laravel (http://www.tutorialspoint.com/laravel/laravel_routing.htm) we can call inline function from route file. Is it possible to do the same in cakephp?