我试图通过使用下面的链接在ACL和ARO中使用Cakephp 3.6创建模块权限系统,因为我需要根据权限显示和隐藏模块。
参考链接 https://code.tutsplus.com/tutorials/how-to-use-cakephps-access-control-lists--net-13457
现在我在下面的函数中调用Auth类的对象时遇到错误。请帮助我建议
<?php
namespace App\View\Helper;
use Cake\View\Helper;
class AccessHelper extends Helper
{
var $helpers = array("Session");
public function isLoggedin(){
App::import('Component', 'Auth');
$this->Auth = new AuthComponent();
$this->Auth->Session = $this->Session;
$this->user = $this->Auth->user();
}
}
?>
但这显示了一个错误找不到类'App \ View \ Helper \ App'