symfony 1.4: How to pass exception message to error.html.php?

前端 未结 3 1849
情歌与酒
情歌与酒 2020-12-30 16:13

I tried using special variable $message described here http://www.symfony-project.org/cookbook/1_2/en/error_templates but it seems this variable isn\'t defined

3条回答
  •  再見小時候
    2020-12-30 16:41

    I think I found a much simpler answer. On Symfony 1.4 $message is indeed not defined, but $exception is (it contains the exception object).

    So just echo $exception->message.

    Et voilà!

提交回复
热议问题