creocoder / yii2-nested-sets

The nested sets behavior for the Yii framework.
Other
446 stars 129 forks source link

error in documentation with behavior configuration #56

Closed witzawitz closed 9 years ago

witzawitz commented 9 years ago

Hi. Thank you for the extension. Just want to say you have an error in the documentation. When configuring behavior with parameters we should use array and place it in array of behaviors. So instead of

    public function behaviors() {
        return [
            'class' => NestedSetsBehavior::className(),
            // 'treeAttribute' => 'tree',
            // 'leftAttribute' => 'lft',
            // 'rightAttribute' => 'rgt',
            // 'depthAttribute' => 'depth',
        ];
    }

there should be this

    public function behaviors() {
        return [
            [
                'class' => NestedSetsBehavior::className(),
                // 'treeAttribute' => 'tree',
                // 'leftAttribute' => 'lft',
                // 'rightAttribute' => 'rgt',
                // 'depthAttribute' => 'depth',
            ]
        ];
    }
creocoder commented 9 years ago

@witzawitz Good catch! Thanks a lot! ;)