sortable-model Helper for managing manually created order of models

  1. Usage
  2. Resources

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

Usage

  1. Copy/Clone dir in protected/extensions/SortableModel:
    git clone https://github.com/wapmorgan/SortableModel.git protected/extensions/SortableModel
    
  2. 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.

Resources

2 0
3 followers
342 downloads
Yii Version: 1.1
License: (not set)
Category: Database
Developed by: wapmorgan
Created on: Dec 22, 2013
Last updated: 3 years ago

Downloads

show all

Related Extensions