Posts Tagged with yii 1

Displaying 51-60 of 72 results.
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 get value from url GET name
posted by admin on March 30, 2016
I'd like to know if there is an Yii function to get a value from url. The url that I have is:

http://www.domain.com/index.php/module/controller/update/id/111

I need to get the value '111' before it gets to the update action, is there an Yii method to do it?Read more
Resolved: Yii CListView itemView from another directory
posted by admin on March 30, 2016
In controller

$dataProvider = new CActiveDataProvider('Media');
$this->render('index',array(
'dataProvider'=>$dataProvider,
));


In View index.php

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


I want to pass $dataProvider to another file in another directory.
For example I want to call the file post/_view.phpRead more
Resolved: Yii Readonly Field in CActiveForm form textField
posted by admin on March 30, 2016
My row in _form.php

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'user-form',
// Please note: When you enable ajax validation, make sure the corresponding
// controller action is handling ajax validation correctly.
// There is a call to performAjaxValidation() commented in generated controller code.
// See class documentation of CActiveForm for details on this.
'enableAjaxValidation'=>true,
)); ?>

<p class="note">Fields with <span class="required">*</span> are required.</p>

<?php echo $form->errorSummary($model); ?>
. . .
<div class="row">
<?php echo $form->labelEx($model,'username'); ?>
<?php echo $form->textField($model,'username',array('size'=>50,'maxlength'=>50)); ?>
<?php echo $form->error($model,'username'); ?>
</div>
. . .
<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
</div>

<?php $this->endWidget(); ?>

</div><!-- form -->


I want to make my username readonlyRead more