0
我怎樣才能從zend框架插件查詢? ZF2 MVC global functionzend框架2從插件查詢
這裏是我當前的代碼在我的插件: 我創建插件使用此代碼
namespace Users\Controller\Plugin;
use Zend\Mvc\Controller\Plugin\AbstractPlugin;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\Session\Container as SessionContainer;
use Zend\Session\Container;
use Zend\Db\Adapter\Adapter;
class MenuPlugin extends AbstractPlugin
{
protected $permissionsTable;
public function availableLinks($theController = '', $modules = '')
{
$moduleId = 0;
foreach ($modules as $row) {
$moduleId = $row->id;
}
$session_user = new Container('user');
$roleId = $session_user->user_data['roleId'];
$the_functions = $this->getPermissionsTable()->getAvailableFunctions($moduleId,$roleId);
return $the_functions;
}
public function getPermissionsTable()
{
if (!$this->permissionsTable)
{
$sm = $this->getServiceLocator();
$this->permissionsTable = $sm->get('Users\Model\PermissionsTable');
}
return $this->permissionsTable;
}
}
目前仍然是一個錯誤,我的應用程序返回錯誤500 – jeck120591 2014-10-30 07:43:35
您可以檢查您的錯誤日誌並提供更具體的錯誤信息嗎? – 2014-10-30 07:53:33
它說: 致命錯誤:在/webapps/JerickAlita/new_cms/module/Users/src/Users/Controller/Plugin/MuenPlugin.php找不到接口'Users \ Controller \ Plugin \ ServiceLocatorAwareInterface' – jeck120591 2014-10-30 08:34:49