fork download
  1. <?php
  2.  
  3. public function actionGenre()
  4. {
  5. if(isset($_GET['id'])){
  6. $id = (int)$_GET['id'];
  7. $books = new CActiveDataProvider('Book', array(
  8. 'criteria' => array(
  9. 'with' => array('genres'=>array('alias'=>'genre')),
  10. 'condition' => 'genre.genre_id=:genre_id',
  11. 'params' => array(':genre_id'=>$id),
  12. ),
  13. 'pagination' => array(
  14. 'pageSize'=>20,
  15. ),
  16. ));
  17. }
  18. $this->render('genre', array('books'=>$books));
  19. }
Runtime error #stdin #stdout #stderr 0.02s 24448KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected 'public' (T_PUBLIC) in /home/g5yBsh/prog.php on line 3