PHPackages                             yii2tech/ar-position - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. yii2tech/ar-position

AbandonedArchivedYii2-extension[Database &amp; ORM](/categories/database)

yii2tech/ar-position
====================

Provides support for ActiveRecord custom sort in Yii2

1.0.1(8y ago)114282.0k↓23.4%1620BSD-3-ClausePHP

Since Dec 26Pushed 6y ago8 watchersCompare

[ Source](https://github.com/yii2tech/ar-position)[ Packagist](https://packagist.org/packages/yii2tech/ar-position)[ RSS](/packages/yii2tech-ar-position/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (20)

 [ ![](https://avatars2.githubusercontent.com/u/12951949) ](https://github.com/yii2tech)

ActiveRecord Position Extension for Yii2
========================================

[](#activerecord-position-extension-for-yii2)

This extension provides support for ActiveRecord custom records order setup.

For license information check the [LICENSE](LICENSE.md)-file.

[![Latest Stable Version](https://camo.githubusercontent.com/0a6e45dab665f1c028a80608b14d1fda4e55d1050cdea363f0df65273342de71/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79696932746563682f61722d706f736974696f6e2e737667)](https://packagist.org/packages/yii2tech/ar-position)[![Total Downloads](https://camo.githubusercontent.com/23cf05a58668675927da7ca63d6bae982d5ded279221bc06d75649466ea97f49/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79696932746563682f61722d706f736974696f6e2e737667)](https://packagist.org/packages/yii2tech/ar-position)[![Build Status](https://camo.githubusercontent.com/56f661902be0b80cf4961488818a0eba747c9ba2b84ba761be6e81c8ba5232ea/68747470733a2f2f7472617669732d63692e6f72672f79696932746563682f61722d706f736974696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yii2tech/ar-position)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist yii2tech/ar-position

```

or add

```
"yii2tech/ar-position": "*"
```

to the require section of your composer.json.

Usage
-----

[](#usage)

This extension provides support for custom records order setup via column-based position index.

This extension provides `\yii2tech\ar\position\PositionBehavior` ActiveRecord behavior for such solution support in Yii2. You may attach it to your model class in the following way:

```
