Posts Tagged with DetailView

Displaying 1-3 of 3 results.
Resolved: Yii 1.1 Cgridview filter listdata without findAll from db, with php array
posted by admin on November 7, 2016
I have CGridView with select filter, and I want to insert select box info manually with php array.
Now I have result with findAll():

<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'application-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
...
array(
'name'=>'status_id',
'value'=>'$data->status->name',
'type'=>'html',
'filter' => CHtml::listData(Status::model()->findAll(), 'id', 'name'),
),
...
),
)
);
Read more
Resolved: Yii 1.1 How to get attribute from model attributeLabels function in CDetailView custom field
posted by admin on October 12, 2016
I have this CDetailView

<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'username',
'personal_email',
'work_email',
array(
'label' => Yii::t('translation', 'Created'),
'type' => 'raw',
'value' => app::datetimeUserFriendly($model->created),
),
'updated',
. . .
),
)); ?>

I want to read label from model attributeLabels.Read more
Resolved: Yii 1.1 CDetailView visibility, check condition if else
posted by admin on March 6, 2016
I have CDetailView, and I want to check some condition and if condition is true, allow row output, else hide row from detailview table

<?php
$this->widget('zii.widgets.CDetailView', array(
'data' => $model,
'attributes' => array(
'id',
'username',
'balance',
'pro',
'email_delivery:boolean',
array(
'label' => Yii::t('translation', 'About'),
'type' => 'raw',
'value' => $model->about,
),
),
));
?>


How to write condition to about?Read more