Yii – Exit or End a Controller action

  • Yii Articles

  • Blog Subjects

  • To exit or end processing in a controller action use the end  function

     PHP |  copy code |? 
    1
    2
          	Yii::app()->end();
    3
     
    4

    For example; this may be used to terminate processing if invalid, incorrect or missing parameters are passed

     PHP |  copy code |? 
    1
    2
     
    3
       if (empty($_GET))
    4
           	Yii::app()->end();
    5
     
    6