dongyu1918 2013-04-22 14:28
浏览 24

Symfony 1.2 - 返回sfView :: ERROR重定向到SUCCESS

I use Symfony to write my code for about two years, but this is the first time I'm trying to use return sfView::ERROR feature.

The problem is, it doesn't work. Even if my controller looks like:

public function executeSomething(){  

  return sfView::ERROR;

}

and I have two files under templates directory:

somethingSuccess.php
somethingError.php

it still displays success view.

Symfony version is: 1.2

update:

this is part from my debug log:

57  Info PHPView    Render "sf_app_dir/modules/project/templates/somethingSuccess.php"
58  Info PHPView    Decorate content with "sf_app_dir/templates/clean.php"
59  Info PHPView    Render "sf_app_dir/templates/clean.php"
60  Info WebResponse    Send status "HTTP/1.1 200 OK"
61  Info WebResponse    Send header "Content-Type: text/html; charset=utf-8"

even if I add return 'Blabla'; which should get somethingBlabla.php as view, or at least produce error, it still gets SUCCESS.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 cad图纸,chx-3六轴码垛机器人
    • ¥15 移动摄像头专网需要解vlan
    • ¥20 access多表提取相同字段数据并合并
    • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
    • ¥20 Java-Oj-桌布的计算
    • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
    • ¥20 有人知道这种图怎么画吗?
    • ¥15 pyqt6如何引用qrc文件加载里面的的资源
    • ¥15 安卓JNI项目使用lua上的问题
    • ¥20 RL+GNN解决人员排班问题时梯度消失
    • ¥50 esp32 wroom 32e 芯片解锁