سؤال

I am using ACL functionality in zend framwork.It is working fine.Now i want to check which resources added in ACL from view files.
For Example i added two controller in ACL resources like CmsController and UserController. Now i want this controller in Layout header.phtml File.
How can i check this ACL in view file ? Any help will be appreciated.

هل كانت مفيدة؟

المحلول

In a general way, ACLs could be accessed from anywhere. A simple way to do it is :

1) Store it in your registry : Zend_Registry::set('acl', $myACLObject);

2) Get it when you want : Zend_Registry::get('acl');

For your specific problem, layout has access to each view variables you declared in the controller :

1) Declare your variable in the controller : $this->view->myVarACL = $myACLObject;

2) And in the layout, you can do this : var_dump($this->myVarACL);

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top