yii - cannot echo data in a file located in extension/bootstraps/widgets -
i using yii 1.1 .i have class file inside widgets folder named mycommentstbeditablesaver. when try echo data in php file .it doesnot return thing. reason behind this? code:`
public function insertrps() { //get params request $this->primarykey = yii::app()->request->getparam('pk'); $this->attribute = yii::app()->request->getparam('name'); //$this->attribute = yii::app()->request->getparam('comments'); $this->value = yii::app()->request->getparam('value'); //checking params if (empty($this->attribute)) { throw new cexception(yii::t('mycommentstbeditablesaver.editable', 'property "attribute" should defined.')); } if (empty($this->primarykey)) { throw new cexception(yii::t('mycommentstbeditablesaver.editable', 'property "primarykey" should defined.')); } $model=new projectcomments(); $comments=yii::app()->db->createcommand() ->select('count(project_id) countproject') ->from('pm_project_comments') ->where("project_id = $this->primarykey ") ->queryrow(); if($comments['countproject']==0) { $model->isnewrecord=true; $model->comments_rps=$this->value; $model->project_id=$this->primarykey; //also set update details,added bishal $model->crtd_by=yii::app()->user->id; $model->crtd_dt = date('y-m-d'); print_r($model);die; $model->save(); } }`
Comments
Post a Comment