×

Sign in with twitter.

You can follow the user and hashtags.

Share your tips on social media.

Post relative tips.

If you have relative tips, click [Add relative tips] to post.

CakePHPのTreeBehaviorで末端のノードのみを取得する方法

@mon_sat@mon_sat 2262 viewer 52 embed viewer embed
leftとrightが連番になっていたら末端とみなすことができるので

Categoryモデルで find('list') する例

$conditions = array('Category.lft = Category.rght - 1');
$this->Category->find('list', compact('conditions'));

#CakePHP

#TreeBehavior

Click this to change format.

Add relative tips

Users who share this tip.

Comments