Napisałem plugin ktory ma na celu sprawdzenie czy uzytkownik jest zalogowany:
Kod
class Zend_Controller_Plugin_Authorization extends Zend_Controller_Plugin_Abstract
{
public function __construct()
{
$auth = Zend_Auth::getInstance();
if(!$auth->hasIdentity())
{
$controller= Zend_Controller_Action::getRequest()->getActionName();
}
}
}
{
public function __construct()
{
$auth = Zend_Auth::getInstance();
if(!$auth->hasIdentity())
{
$controller= Zend_Controller_Action::getRequest()->getActionName();
}
}
}
Chodzi o to zeby klasa sprawdzala czy uzytkownik jest zalogowany oraz czy zaladowany kontrolelr jest rozny od index, problem tkwi w pobraniu nazwy kontrolera ktory uzytkownik wywolal
dostaje blad:
Strict Standards: Non-static method Zend_Controller_Action::getRequest() should not be called statically, assuming $this from incompatible context in...
Fatal error: Cannot access protected property Zend_Controller_Plugin_Authorization::$_request in ...library/Zend/Controller/Action.php on line 301
Zaznaczam ze jestem poczatkujacy oraz nie zoreintowany za bardzo w OOP, wiec za odpowiedzi typu "link do manuala tam wszystko jest" dziekuje, poniewaz to mi nie pomoglo.