Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AidasK committed May 2, 2013
1 parent f287230 commit e9bfd6f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,36 @@ Yii Closure Table behavior

Extension allows managing trees stored in database.

Configuration
-------------

Add behavior to model as follows:

```php
public function behaviors()
{
return array(
'closureTableBehavior'=>array(
'class'=>'ext.ClosureTableBehavior',
'closureTableName'=>'table_name',
)
);
}
```

Examples
--------

Model configuration: /tests/models/Folder.php

Schema example: /tests/schema/db.sql

Behavior usage: /tests/unit/ClosureTableBehaviorTest.php


Literature:
-----------

http://www.slideshare.net/billkarwin/models-for-hierarchical-data

http://www.mysqlperformanceblog.com/2011/02/14/moving-subtrees-in-closure-table/

0 comments on commit e9bfd6f

Please sign in to comment.