在CakePHP中的管理部分 [英] Admin section in CakePHP

查看:93
本文介绍了在CakePHP中的管理部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难理解CakePHP管理系统的工作原理。

I'm having a hard time understanding how the CakePHP admin system works.


  • 如果所有控制器都有需要登录的操作包括AuthComponent或只处理登录/注销的用户?

  • 假设我想保护控制器的添加操作。首先我在控制器中创建 admin_add(),然后在 beforeFilter()方法中检查 $ this-> Session-> check('Auth.User')基于这个设置了一个重定向? c $ c> $ this-> Auth-> allow()

  • 返回用户网址的最简单方法是什么试图访问?是否有比设置会话变量更好的方法?原来这是自动执行的:)

  • Should all controllers who has an action which requires login include AuthComponent or just the one who handles the login/logout?
  • Let's say I want to protect the add action of a controller. First I create admin_add() in the controller and then in the beforeFilter() method I check if $this->Session->check('Auth.User') is set a redirect based on this? Turns out it was better to just controll this with $this->Auth->allow()
  • What is the easiest way to return to the URL the user was trying to access? Is there a better way than setting a session variable? Turns out it does this automagically :)

好的教程,我会高兴地阅读它:)
我已经阅读这个教程,但我发现它是一个有点基本和CakePHP文档在这个主题也不是那么好。

If someone has a good tutorial for this I would happily read it :) I've already read this tutorial but I found it to be a little to basic and the CakePHP-docs are not that great on this topic either.

推荐答案

没有Cake管理系统。有身份验证组件,还有访问控制列表组件。如果您愿意,您可以只使用认证组件,也可以使用两者。如果您要从头开始创建管理系统,请按照教程。或者,您也可以尝试已创建的管理面板 - PoundCake控制面板

There is no Cake admin system as such. There is Authentication component and there is Access Control List component. You can use only Authentication component if you wish or you can use both of them. If you want to create your admin system from scratch follow this tutorial. Or you can try already created admin panel - PoundCake Control Panel.

这篇关于在CakePHP中的管理部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆