Heim  >  Artikel  >  Backend-Entwicklung  >  cakephp setFlash()及flash()方法都不起作用,setFlash()的具体用法及简单案例,该如何处理

cakephp setFlash()及flash()方法都不起作用,setFlash()的具体用法及简单案例,该如何处理

WBOY
WBOYOriginal
2016-06-13 10:17:23896Durchsuche

cakephp setFlash()及flash()方法都不起作用,setFlash()的具体用法及简单案例
最近用cakephp框架开发,发现setFlash()方法不起作用,改方法主要用于提示信息并进行页面跳转,求助!
如果能够提供一个setFlash()使用案例最好
以下是本人代码:
1.players_controlly.php

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->            /*     * 删除视频信息     * @param    $id     */    public function del_player($id=0) {        if ($id==0 || empty($id)){            $this->flash("参数错误,请确认操作.","javascript:history.go(-1);");        }else{            $movie_info=$this->players->check_player_id($id);            if ($movie_info){                $this->list_player();                   $this->render(null, null, 'list_player');            }else{                $this->flash("参数错误,请确认操作.","javascript:history.go(-1);");//或者   $this->Session->setFlash('参数错误,请确认操作.', 'default', array('class' => 'type_class'))            }        }    }


   


------解决方案--------------------
http://blog.csdn.net/donnki/article/details/1771770
http://book.cakephp.org/1.3/cn/view/1313/setFlash
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn