tree-extension TreeBehavior TreeActions TreeWidget

  1. Documentation
  2. Change Log

Documentation

Requirements
  • Yii 1.0 or above
Installation
  • Extract the release file under protected/extensions
Usage

See the following code example: ~~~ //in model public function behaviors() {

return array(
'TreeBehavior' => array(
            'class' => 'ext.tree.behaviors.TreeBehavior',

'id'=>'id', 'parent_id'=>'parent_id', ...

        ),
);

}

//in controller

public function actions() {

    return array(
        'treeMoveUp'=>'ext.tree.actions.TreeMoveUpAction',
        'treeMoveDown'=>'ext.tree.actions.TreeMoveDownAction',
        'treeCreate'=>'ext.tree.actions.TreeCreateAction',
        'treeUpdate'=>'ext.tree.actions.TreeUpdateAction',
        'treeLoad'=>'ext.tree.actions.TreeLoadAction',
        'treeDelete'=>'ext.tree.actions.TreeDeleteAction',
        'treeChildren'=>'ext.tree.actions.TreeChildrenAction',
        'treeChildrenParent'=>'ext.tree.actions.TreeChildrenParentAction',
    );

}

public function actionAdmin() {

$this->render('admin');

}

//in admin[view]

$this->widget('ext.tree.widgets.TreeWidget',array('modelName'=>'YOur treeModel'));

//default tree schema CREATE TABLE IF NOT EXISTS tree ( id int(11) NOT NULL AUTO_INCREMENT, lft int(11) NOT NULL, rgt int(11) NOT NULL, level int(11) NOT NULL, parent_id int(11) NOT NULL, name varchar(256) NOT NULL, PRIMARY KEY (id) ) ~~~

请下载tree.v2.zip,谢谢

Change Log

April 6, 2010
  • Initial release.
4 8
4 followers
2 657 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Database
Tags:
Developed by: qq71151461
Created on: Apr 7, 2010
Last updated: 12 years ago

Downloads

show all