Zend-Framewok eklentisi, nasıl $ simular somthing yapmak için bu-> görünüm-> foo = ...;?

0 Cevap php

i wrote a small plugin, so i will be able to get the name of the controller in each view. but idk how to "pass" a parameter to the view (do sumth like $this->view->foo =...;).

class Zend_Extension_Controller_Plugin_GetControllerName extends Zend_Controller_Plugin_Abstract
{

    public function __construct()
    {

    }

    public function preDispatch(Zend_Controller_Request_Abstract $request)
    {
        $this->view->controllerName = $request->getControllerName();
    }
}

bu iş olacak ne yani ben yerine $ this-> görünüm-> ControllerName içinde yazabilirim?

0 Cevap