【问题标题】:What is the differences between bind model and contain cakephp?绑定模型和包含 cakephp 有什么区别?
【发布时间】:2011-08-26 23:27:36
【问题描述】:

bind model 和 contains cakephp 有什么区别?任何人有想法请与我分享..我是cakephp的新手

【问题讨论】:

    标签: cakephp cakephp-1.3


    【解决方案1】:

    注意:此答案与不再支持的 CakePHP 1.3 版有关。

    CakePHP 最强大的特性之一是能够链接模型提供的关系映射。在 CakePHP 中,模型之间的链接是通过关联来处理的。 如果您在模型中设置这些关联,那么当您检索数据时,Cake 也会自动检索关联数据。

    可包含的行为允许您过滤和限制模型查找操作(假设您已设置模型关联)

    https://book.cakephp.org/1.3/en/The-Manual/Core-Behaviors/Containable.html

    绑定和取消绑定对于动态更改模型关联很有用:

    https://book.cakephp.org/1.3/en/The-Manual/Developing-with-CakePHP/Models.html#creating-and-destroying-associations-on-the-fly

    【讨论】:

    • 谢谢,我已经更正了链接,但 1.3 版早已不复存在。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-03
    • 2012-05-24
    相关资源
    最近更新 更多