php - How to display message in yii framework? -
I am working in a jobstate, I have a controller My Controller is Sitecontroler.php You have to show it in view 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' .
'*', "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;
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
Post a Comment