i have class Plugin_Magazine extends Zend_Controller_Action
in some views i need to call static function test() from it.
in view i do folowing:
$class_name = 'Plugin_'.$plugin;
$class_name::test();
as a result i have
Catchable fatal error: Argument 1 passed to
Zend_Controller_Action::__construct() must be an instance of
Zend_Controller_Request_Abstract, none given
but, if i create class Plugin_Magazine w\o extends all works fine.
question is: can i somehow do what i need or just forget about inheritance?
You need to pass a Request object to the constructor of the Action class
At somepint your doing this:
But you need to pass the request object:
As for this call:
Why do you need a static function in an Action? This doesn’t seem right, if it’s reusable logic that exists in an Action that it should be moved elsewhere to where it can be used more easily, like into a Model.