zend-framework 中第三种添加角色的不同之处
在zend框架中我们可以添加三种类型的acl我想知道它们之间有什么不同
$acl = new Zend_Acl();
// 1st type
$acl -> addRole(new Zend_Acl_Role('someuser'));
// 2nd type
$acl -> add (new Zend_Acl_Role('someuser'));
// 3rd type
$acl -> addRole('someuser');
in zend frame work we can add acl in three type I want to know what is different between them
$acl = new Zend_Acl();
// 1st type
$acl -> addRole(new Zend_Acl_Role('someuser'));
// 2nd type
$acl -> add (new Zend_Acl_Role('someuser'));
// 3rd type
$acl -> addRole('someuser');
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一个和第三个完全一样。根本没有区别。
addRole 函数中会发生以下情况:
由于
$role
是给定参数,因此两者相同。第二种类型已被弃用(并用于资源),因此应避免使用它。
The first and third are exactly the same. There simply is no difference.
The following happens in the addRole function:
Since
$role
is the given parameter the two are the same.The second type is deprecated (and used for resources) so using it should be avoided.