Displaying 71-80 of 109 results.
Resolved: Yii Dropdown List Empty Value as Default
posted by admin on April 7, 2016

<?php $type_list=CHtml::listData($galleries,'id','name'); ?>
<?php echo $form->dropDownList($model, 'gallery_id', $type_list); ?>


I want to add empty option to SELECT
In output, I want to get

<select name="sel" id="sel">
<option value="0">Choose Gallery</option>
...
</selected>
Read more
Resolved: Yii 1.1 CHtml listData with relation table
posted by admin on April 5, 2016
I have the list of array from my model

CHtml::listData($tags, 'id', 'post_id')


In model

/**
* @return array relational rules.
*/
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'post' => array(self::BELONGS_TO, 'Post', 'post_id'),
);
}


I want to get listData like this

CHtml::listData($tags, 'id', /*here is syntax to get relation name*/)
Read more
Resolved: Yii 1.1 Get last inserted id
posted by admin on April 5, 2016
I want to get my new inserted row id after save

if ($model->save) :
...
//Do something with my new id
...
endif;
Read more
Resolved: Yii 1.1 Check if the row exist do nothing else insert
posted by admin on April 5, 2016
I have multiple insert to my table, and my inserted values must be unique. I want to check , if my row don't exist, then insert my rowRead more
Wiki: Yii 1.1 Model Save problem in MySQL queryor in update actionwiki
posted by admin on April 5, 2016
In my update Action

if($model->save()) :
...
endif;


And I have problem with MySQL save, it is Yii errorRead more
Resolved: Yii 1.1 How to change default language
posted by admin on April 5, 2016
I want to change my website default language and read translation file by default to my website language.Read more
Resolved: Yii CActiveDataProvider change default post count
posted by admin on March 30, 2016
In controller:

$dataProvider = new CActiveDataProvider('Media');


I want to change default post count in one pageRead more
Resolved: Yii CListView pass data to view
posted by admin on March 30, 2016

<?php
$mode = "My Custom Value";

$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
)); ?>
Read more
Resolved: Yii CListView unique id attribute div
posted by admin on March 30, 2016

<?php
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
)); ?>


I want to edit and change id of parent divRead more
Resolved: Yii - Modifing html generated by CListView by default
posted by admin on March 30, 2016
I want to change generated HTML by CListView to ul li construction.
This is my CListView

<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
)); ?>
Read more