mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
docs/guide/output-data-widgets.md typo fix [ci skip] (#13459)
This commit is contained in:
committed by
Alexander Makarov
parent
7c1693479f
commit
8803496cf5
@ -29,8 +29,8 @@ echo DetailView::widget([
|
|||||||
[ // the owner name of the model
|
[ // the owner name of the model
|
||||||
'label' => 'Owner',
|
'label' => 'Owner',
|
||||||
'value' => $model->owner->name,
|
'value' => $model->owner->name,
|
||||||
'contentOptions' => ['class' => 'bg-red'], // to HTML customize attributes of value tag
|
'contentOptions' => ['class' => 'bg-red'], // HTML attributes to customize value tag
|
||||||
'captionOptions' => ['tooltip' => 'Tooltip'], // to HTML customize attributes of label tag
|
'captionOptions' => ['tooltip' => 'Tooltip'], // HTML attributes to customize label tag
|
||||||
],
|
],
|
||||||
'created_at:datetime', // creation date formatted as datetime
|
'created_at:datetime', // creation date formatted as datetime
|
||||||
],
|
],
|
||||||
@ -38,8 +38,8 @@ echo DetailView::widget([
|
|||||||
```
|
```
|
||||||
|
|
||||||
Remember that unlike [[yii\widgets\GridView|GridView]] which processes a set of models,
|
Remember that unlike [[yii\widgets\GridView|GridView]] which processes a set of models,
|
||||||
[[yii\widgets\DetailView|DetailView]] processes just one. So most of the times there is no need for using closure since
|
[[yii\widgets\DetailView|DetailView]] processes just one. So most of the time there is no need for using closure since
|
||||||
`$model` is the only one model for display and available in view as variable.
|
`$model` is the only one model for display and available in view as a variable.
|
||||||
|
|
||||||
However some cases can make using of closure useful. For example when `visible` is specified and you want to prevent
|
However some cases can make using of closure useful. For example when `visible` is specified and you want to prevent
|
||||||
`value` calculations in case it evaluates to `false`:
|
`value` calculations in case it evaluates to `false`:
|
||||||
@ -600,7 +600,7 @@ $query->andFilterWhere(['LIKE', 'author.name', $this->getAttribute('author.name'
|
|||||||
> $query->andFilterWhere(['LIKE', 'au.name', $this->getAttribute('author.name')]);
|
> $query->andFilterWhere(['LIKE', 'au.name', $this->getAttribute('author.name')]);
|
||||||
> ```
|
> ```
|
||||||
>
|
>
|
||||||
> The same is `true` for the sorting definition:
|
> The same is true for the sorting definition:
|
||||||
>
|
>
|
||||||
> ```php
|
> ```php
|
||||||
> $dataProvider->sort->attributes['author.name'] = [
|
> $dataProvider->sort->attributes['author.name'] = [
|
||||||
|
|||||||
Reference in New Issue
Block a user