On some other frameworks i can describe hook and with that , before everypage run,this hook running ( this hook is controller like anyother page but its working before every page)

Is there anything like that ?


Thanks for ur response but i already know initialize. I dont want to write my code every controller , i will create a controller and it will run before every controller

(i.e : http://ellislab.com/codeigniter%20/user-guide/general/hooks.html)

you can implement a base controller, write the initialize in that ,and other controller extends from this base controller

class BaseController extends \Phalcon\Mvc\Controller{
    public function initialize()
        # your hook code here;


and other controller like this

class OtherController extends BaseController{


hope it can help you


Thanks NitronPlus , it will help me