Points to Remember in Yii

1)Yii application is build using Model-View-Controller(MVC) architecture.

2) Yii implements two kinds of model form model (CFormModel class) and active records(CActiveRecord class),which are extended by same base class cmodel.

3)form model represent the logic for form fields validation and bussiness logic.

4)Active records is design pattern of database structure to abstract the data access in object oriented way.

5)Controller is responsible for taking form inputs,interacting with model and passing the updated info to the view.

6)The router is action taken place as user sent request to the application.

yii work flow

yii work flow


Please share any of the important points in yii in comments.thank you


Tagged with: , , , , , ,
Posted in php, yii framework

forEach vs for loop in javascript

I tried the  run the javascript array in forech and for loop and i faced the issue like undefined in forech loop .

Example foreach Loop:


Example For Loop:


any solution for foreach  and Please share your experience in it.



Tagged with: , , , , ,
Posted in javascript

Tips to move from php to java

Hello Friends

I am pramodh kumar have work experience of 3 years in php and have worked in various framework and cms .currently i am looking for mnc company job for permanent position,bad luck no multi national company uses the php technology .I have heard about that tcs,infosys,wipro uses php technology,but I am willing to settle down in companies like bosch,benz,bmw ,i know its engineering companies and they used embedded c,c++,java and .net. So I am willing to learn java and done certification 5 years before.So guide me advice to learn java and recommend to use framework like stucts,spring,hibernate,osgi,rcp etc Bosch mostly have vacancy regarding in RCP areas.So friends comment any suggestion,tips and recommendation.

Tagged with: , , , , , , , , , ,
Posted in java

How configure php in environment varible for windows?

To configure php in environment variable for windows,just run below code with current wamp path in command prompt:

SET PATH=%PATH%;C:\your\wamp\path\php

C:\>php -a
Interactive mode enabled
echo 'pppp';
echo "hello world";
echo 'pppp';
hello world

to finish the code with <?php and end ?> to run the code just (^z) Press control button + (z) button.
Tagged with: , , , , , ,
Posted in php

yii onchange ajax validation issue(cleared)

I was working the yii project in which i have update form ,where the data are  populated from controller to view allow model data to controller render function in yii.I had reset button in which default worked ,but as i update the form empty madtory field raised validation issue as i clicked the reset button it didnt restored the mandatory field.so assigned copy model varible by calling  findByPk


$id = $_REQUEST['id'];
$modelular= Milestones::model()->findByPk($id);
javascript function to reset the update form.
 $("#resetform").click(function(e) {
 e.preventDefault();//used rectifier the jquery issue
 // $("#milestones-form").trigger('reset');
 $("#Milestones_milestone_title").val("<?php echo $copymodel->milestone_title; ?>");
 $("#Milestones_milestone_description").val("<?php echo $copymodel->milestone_description; ?>");
 $('#Milestones_milestone_startdate').datepicker('setDate', "<?php echo date('d-m-Y',strtotime($copymodel->milestone_startdate));?>");
 $("#Milestones_milestone_duedate").datepicker('setDate', "<?php echo date('d-m-Y',strtotime($copymodel->milestone_duedate));?>");

Onchange Issue:

Then comes the testing department issue that form does hides the validation msg after filling the input fields.

just added code in controller function.
View :
<?php $form=$this->beginWidget('CActiveForm', array(
)); ?>

 echo $form->textField($model,'milestone_title',array('class'=>'betterform','style'=>'width:95%','maxlength'=>100,'tabindex'=>1));
 // echo CHtml::label(Yii::t('milestones','FormMilestoneTitle'), CHtml::activeId($model, 'milestone_title'), array('class'=>'labelhelper'));
 echo $form->error($model,'milestone_title',array('validateOnChange'=>true));
Tagged with: , , , , , , , , , , , ,
Posted in yii framwork
Follow php tutorial on WordPress.com
November 2015
« Sep    
Follow me on Twitter
Blog Stats
  • 65,499 hits

Get every new post delivered to your Inbox.

Join 45 other followers

%d bloggers like this: