Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
474e664c
Commit
474e664c
authored
Jul 08, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
phpdoc code
parent
492337de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
Sort.php
framework/data/Sort.php
+11
-10
No files found.
framework/data/Sort.php
View file @
474e664c
...
...
@@ -23,7 +23,7 @@ use yii\web\Request;
*
* A typical usage example is as follows,
*
*
~~~
*
```php
* function actionIndex()
* {
* $sort = new Sort([
...
...
@@ -48,18 +48,18 @@ use yii\web\Request;
* 'sort' => $sort,
* ]);
* }
*
~~~
*
```
*
* View:
*
*
~~~
*
```php
* // display links leading to sort actions
* echo $sort->link('name') . ' | ' . $sort->link('age');
*
* foreach ($models as $model) {
* // display $model here
* }
*
~~~
*
```
*
* In the above, we declare two [[attributes]] that support sorting: name and age.
* We pass the sort information to the Article query so that the query results are
...
...
@@ -86,7 +86,7 @@ class Sort extends Object
* @var array list of attributes that are allowed to be sorted. Its syntax can be
* described using the following example:
*
*
~~~
*
```php
* [
* 'age',
* 'name' => [
...
...
@@ -96,19 +96,19 @@ class Sort extends Object
* 'label' => 'Name',
* ],
* ]
*
~~~
*
```
*
* In the above, two attributes are declared: "age" and "name". The "age" attribute is
* a simple attribute which is equivalent to the following:
*
*
~~~
*
```php
* 'age' => [
* 'asc' => ['age' => SORT_ASC],
* 'desc' => ['age' => SORT_DESC],
* 'default' => SORT_ASC,
* 'label' => Inflector::camel2words('age'),
* ]
*
~~~
*
```
*
* The "name" attribute is a composite attribute:
*
...
...
@@ -137,12 +137,12 @@ class Sort extends Object
* @var array the order that should be used when the current request does not specify any order.
* The array keys are attribute names and the array values are the corresponding sort directions. For example,
*
*
~~~
*
```php
* [
* 'name' => SORT_ASC,
* 'created_at' => SORT_DESC,
* ]
*
~~~
*
```
*
* @see attributeOrders
*/
...
...
@@ -175,6 +175,7 @@ class Sort extends Object
*/
public
$urlManager
;
/**
* Normalizes the [[attributes]] property.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment