我正在处理我在 Zend 中的第一次用户登录,但我对 Zend_Auth 有点困惑。 我阅读的所有关于它的文章都直接在 Controller 中使用它。但对我来说,在我的用户模型中使用它更有意义,这样每个 Controller 都可以调用这些函数。
大家怎么看?
关于 Zend Framework 模型的文档真的很少。
最佳答案
您可以将身份验证逻辑放入您的用户类中。
看看Matthew Weier O'Phinney's blog post about Model Infrastructure ,他展示了如何将 Zend_Auth_Adapter_Interface
所需的 authenticate
方法添加到自定义用户类。
关于php - 在哪里使用 Zend_Auth,在模型或 Controller 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4450578/