via Phalcon\Dispatcher
You can try
<?php
class TestController extends \Phalcon\Mvc\Controller
{
//This action will be executed after instance created
public function initialize()
{
echo __FUNCTION__, "\n";
}
public function onConstruct()
{
echo __FUNCTION__, "\n";
}
public function anyAction()
{
echo __FUNCTION__, "\n";
}
}
$d = new TestController();
$d->anyAction();
Without Phalcon\Dispatcher function initialize it's never called, because it's an event fire.
Out is ;
onConstruct
anyAction