Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
[Yii] Helper for managing manually created order of models
branch: master

This branch is 3 commits ahead of mousemckill:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

SortableModel is a helper for managing manually created order of models to Yii web framework.


  1. Copy/Clone dir in protected/extensions/SortableModel:
git clone protected/extensions/SortableModel
  1. Open your model and add behavior in behaviors() method like this:
public function behaviors() {
        return array(
            'SortableModel' => array('class' => 'ext.SortableModel.SortableModelBehavior'),
  1. All newly created models will be at the end of list.

  2. To move them, call moveUp() or moveDown().

  3. If you delete a record, all the subsequent records are moved up one position.

Something went wrong with that request. Please try again.