Is it possible to pass anonymous function to router? Something like this?
$router->add('/page', function() { echo ' this is my page'; });
?
If you use a Micro MVC yes: https://docs.phalcon.io/en/latest/reference/micro.html
<?php $app = new Phalcon\Mvc\Micro(); $app->get('/say/welcome/{name}', function ($name) { echo "<h1>Welcome $name!</h1>"; }); $app->handle();
Thanks, I assume there is no other way if I'm not using micro mvc?