Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. controller:
  2.  
  3.     public function actionView($id)
  4.     {
  5.         $post=$this->loadModel();
  6.         $comment=$this->newComment($post);
  7.        
  8.         $this->render('view',array(
  9.             'post'=>$this->loadModel($id),
  10.             'comment'=>$comment,
  11.         ),false,true);
  12.     }
  13.  
  14. request:
  15.  
  16. CHtml::ajaxLink('Try!', array('view', 'id'=>'9'), array('update'=>'#content'));
  17. // id 9 only for example
  18.  
  19. result:
  20.  
  21. <html>
  22.  <body>
  23.   <div id="content">
  24.    <html>
  25.     <body>
  26.      <div id="content"></div>
  27.     </body>
  28.    </html>
  29.   </div>
  30.  </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement