doupoji3856 2012-03-29 22:51 采纳率: 100%
浏览 14

如何允许访问CakePHP 2中的“页面”

At controllers we can do it with:

public function beforeFilter() {
    parent::beforeFilter();     
    $this->Auth->allow('add', 'view', 'edit', 'index', 'verify', 'delete'); 
}

But how to do it on a Page whose controller is by default PageController? I have tried the same that I use in other controllers and it doesn't work.

  • 写回答

1条回答 默认 最新

  • duanbo2048 2012-03-29 23:31
    关注

    You need to copy the PagesController to your app folder and then you can edit it there.

    So in lib/Cake/Controller copy the file PagesController.php to app/Controller.

    You can than edit this file to control the static pages you have.

    评论

报告相同问题?

悬赏问题

  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计