findAllThreaded cakephp

发布于 2024-10-02 07:28:32 字数 109 浏览 0 评论 0原文

我一直在阅读有关 cakephp 中此查找方法调用 findAllThreaded() 的内容,但我尝试了它,但它不起作用...我正在使用 1.3 v 的蛋糕,,,

我需要下载一些代码吗?

i've been reading about this find method call findAllThreaded() in cakephp but i try it and it doesnt work... im working with 1.3 v of cake,,,

Do i have to download some code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

檐上三寸雪 2024-10-09 07:28:32

这在很大程度上取决于您的表结构,但请查看 find('threaded', ...)

This depends heavily on your table structures, but check out find('threaded', ...)

http://book.cakephp.org/view/1023/find-threaded

星軌x 2024-10-09 07:28:32

不,您不需要下载代码,但您可能需要考虑使用树行为。如果使用树行为,您需要将其添加到模型中:

public $behaviors = array('Tree');

然后在数据库表中,您需要添加三列parent_id、lft 和 rght,所有三个值都应该是无符号整数。

然而,使用 find('threaded') 和一个parent_id 就可以得到结果,但我通常使用树行为。

No you do not need to download code but you might want to consider using the tree behavior. If using the tree behavior you will need to add this to your model:

public $behaviors = array('Tree');

Then in your database table you will need to add three columns parent_id, lft and rght, all three values should be unsigned integers.

However it is possible to get results using find('threaded') with just a parent_id, but I usually use the Tree Behavior.

折戟 2024-10-09 07:28:32

请检查外键的命名约定,它应该根据 cakePHP namig 约定。

Please check the naming conventions of foreign key ,it should be according to the cakePHP namig conventions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文