首頁  >  文章  >  php框架  >  yii怎麼跳轉頁面

yii怎麼跳轉頁面

王林
王林原創
2020-02-19 10:38:202546瀏覽

yii怎麼跳轉頁面

【Control】部分:

Yii::app()->user->setFlash('commentSubmitted ','显示跳转后的信息');
$this->redirect('list.m'); //页面跳转,list.m是因为写重写了router

 推薦教學:yii框架

【View】部分:

<?php if(Yii::app()->user->hasFlash(&#39;commentSubmitted &#39;)): ?>
            <div class="flash-success">
                <?php echo Yii::app()->user->getFlash(&#39;commentSubmitted &#39;); ?>
            </div>
<?php endif; ?>

更多程式相關內容,請關注php中文網程式設計入門欄位!

以上是yii怎麼跳轉頁面的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn