php - How to display message in yii framework? -


I am working in a jobstate, I have a controller site controller . I can not display the message using the setFlash function. IE setFlash ('success', "job saved!") in the watch page, see page `search_details.fip' .

My Controller is Sitecontroler.php

   '*', "status" => "id = $ job_id",)); If ($ position == 1) {$ session_id = Yii :: app () - & gt; Session ['user_id']; If ($ session_id == "") {$ this-> Redirect (array ('/ employee / site / login')); } $ User_id = $ session_id; $ Model2 = Will save new; $ Model2- & gt; User_id = $ user_id; $ Model2- & gt; Job_id = $ job_id; If ($ Model2-> Save ()) {Yii :: app () - & gt; User- & gt; Set Flash ('Success', "Save Job!"); }} $ - ('search_detail', array ('model' => = model, 'job_id' = & gt; $ job_id, 'position' => gt; 0)); }? & Gt;    

You have to show it in view

  Lt ;? Php foreach (Yii :: app () - & gt; User-> getFlashes () $ key = & gt; as $ message) {echo '& lt; Div class = "Flash- '. $ Key'. & Gt; '. $ Message' & lt; / Div & gt; \ n ";}? & gt;   



Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -