Category Archives: Yii-php

This is Yii and PHP help blog customer or user will find yii help easily

Yii Add validation for selected fields

On Controller file $model = new Model_Name(); $model->setScenario(‘Articlereview’); $model->field_name = $_POST[‘fname’]; $model->save(); echo CHtml::errorSummary($model); On Model Files Under rule array array(‘field name list’, ‘required’,’on’ => ‘Articlereview’), Advertisements

Posted in Yii-php | Leave a comment

Add condition on model

Add condition in Model. public function relations() { return array( ANY_Name => array(self::MANY_MANY,MODEL_NAME) // this is for common ANY_Name => array(self::MANY_MANY,MODEL_NAME, ‘on’=>’ANY_Name.fied_name = 1’) // this is for conditional } }

Posted in Yii-php | Leave a comment

Yii web application development

–> Create Your First Application. Download Yii Framework. Download PHP Server OR Step of yii installation if you have a server XAMP. put your yii(extract) folder under xamp/htdoc/ if wamp than www/ folder. Now open cmd go … Continue reading

Posted in Yii-php | 3 Comments