34k+
News
Guide
API
Wiki
Forum
Community
Places
Members
Hall of Fame
Badges
More
Learn
Books
Resources
Develop
Download Yii
Extensions
Report an Issue
Report a Security Issue
Contribute to Yii
Donate
About
Release Cycle
License
Team
Official Logos and Design
Login
Creating a database-driven hierarchical Structure combined with CMenu and superfish
Comparing
#9
with
#10
Revision #10 was created by
Alex D.
on Oct 15, 2011, 8:47:10 PM.
correction: $parent = $model->parent; was changed to $parent = $model->getparent;
« Previous (#9)
Next (#11) »
Content
[...]
Now, in our yii console or in the Application we can use
```php
$model = Hierarchy::model()->findByPk(7);
$parent = $model->
get
parent;
echo $parent->title;
// returns 'First Entry'
```
to get the parent element, or
[...]