Jump to content
Larry Ullman's Book Forums

sanfisa

Members
  • Content Count

    2
  • Joined

  • Last visited

Everything posted by sanfisa

  1. Hello, until now, I was using my js script within my view page for testing. Now, as suggested in the Yii Book, I'd like to use registeriing script. I use the command at the end of my view <?php Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl.'/js/comment.js', CClientScript::POS_END); ?> then, I got the syntax error Syntax Error: Unrecognized expression. Do you know where is my mistake ? Thank you in advance for your help
  2. Hello, I'm working in Yii framework. In my index action I created the dataprovider in the following way $connection=Yii::app()->db; $user_id = Yii::app()->user->id; $sql = 'SELECT * FROM post LEFT JOIN comment ON post.id = comment.post_id AND comment.user_id =:user_id LIMIT 0 , 30 '; $command=$connection->createCommand($sql); $command->bindParam(':user_id', $user_id,PDO::PARAM_STR); $rawData = $command->execute(); $dataProvider=new CArrayDataProvider($rawData, array( 'id'=>'user', 'sort'=&
×
×
  • Create New...