Commit 474e664c by Carsten Brandt

phpdoc code

parent 492337de
...@@ -23,7 +23,7 @@ use yii\web\Request; ...@@ -23,7 +23,7 @@ use yii\web\Request;
* *
* A typical usage example is as follows, * A typical usage example is as follows,
* *
* ~~~ * ```php
* function actionIndex() * function actionIndex()
* { * {
* $sort = new Sort([ * $sort = new Sort([
...@@ -48,18 +48,18 @@ use yii\web\Request; ...@@ -48,18 +48,18 @@ use yii\web\Request;
* 'sort' => $sort, * 'sort' => $sort,
* ]); * ]);
* } * }
* ~~~ * ```
* *
* View: * View:
* *
* ~~~ * ```php
* // display links leading to sort actions * // display links leading to sort actions
* echo $sort->link('name') . ' | ' . $sort->link('age'); * echo $sort->link('name') . ' | ' . $sort->link('age');
* *
* foreach ($models as $model) { * foreach ($models as $model) {
* // display $model here * // display $model here
* } * }
* ~~~ * ```
* *
* In the above, we declare two [[attributes]] that support sorting: name and age. * 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 * We pass the sort information to the Article query so that the query results are
...@@ -86,7 +86,7 @@ class Sort extends Object ...@@ -86,7 +86,7 @@ class Sort extends Object
* @var array list of attributes that are allowed to be sorted. Its syntax can be * @var array list of attributes that are allowed to be sorted. Its syntax can be
* described using the following example: * described using the following example:
* *
* ~~~ * ```php
* [ * [
* 'age', * 'age',
* 'name' => [ * 'name' => [
...@@ -96,19 +96,19 @@ class Sort extends Object ...@@ -96,19 +96,19 @@ class Sort extends Object
* 'label' => 'Name', * 'label' => 'Name',
* ], * ],
* ] * ]
* ~~~ * ```
* *
* In the above, two attributes are declared: "age" and "name". The "age" attribute is * In the above, two attributes are declared: "age" and "name". The "age" attribute is
* a simple attribute which is equivalent to the following: * a simple attribute which is equivalent to the following:
* *
* ~~~ * ```php
* 'age' => [ * 'age' => [
* 'asc' => ['age' => SORT_ASC], * 'asc' => ['age' => SORT_ASC],
* 'desc' => ['age' => SORT_DESC], * 'desc' => ['age' => SORT_DESC],
* 'default' => SORT_ASC, * 'default' => SORT_ASC,
* 'label' => Inflector::camel2words('age'), * 'label' => Inflector::camel2words('age'),
* ] * ]
* ~~~ * ```
* *
* The "name" attribute is a composite attribute: * The "name" attribute is a composite attribute:
* *
...@@ -137,12 +137,12 @@ class Sort extends Object ...@@ -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. * @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, * The array keys are attribute names and the array values are the corresponding sort directions. For example,
* *
* ~~~ * ```php
* [ * [
* 'name' => SORT_ASC, * 'name' => SORT_ASC,
* 'created_at' => SORT_DESC, * 'created_at' => SORT_DESC,
* ] * ]
* ~~~ * ```
* *
* @see attributeOrders * @see attributeOrders
*/ */
...@@ -175,6 +175,7 @@ class Sort extends Object ...@@ -175,6 +175,7 @@ class Sort extends Object
*/ */
public $urlManager; public $urlManager;
/** /**
* Normalizes the [[attributes]] property. * Normalizes the [[attributes]] property.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment