我正在尝试使用Template Toolkit作为MojolicIoUs :: Lite中的默认渲染器.是)我有的:
use strict; use warnings; use MojolicIoUs::Lite; use MojolicIoUs::Plugin::TtRenderer; plugin tt_renderer => { template_options => { INCLUDE_PATH => './tmpl',DEBUG => 1 } }; get '/' => sub { my $self = shift; $self->render( 'index' ); }; app->renderer->default_handler( 'tt' ); app->start;
当我尝试点击测试服务器时,我得到:
[Fri Oct 12 14:02:02 2012] [info] Listening at "http://*:3000". Server available at http://127.0.0.1:3000. [Fri Oct 12 14:02:08 2012] [debug] Your secret passphrase needs to be changed!!! [Fri Oct 12 14:02:08 2012] [debug] GET / (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20100101 Firefox/16.0). [Fri Oct 12 14:02:08 2012] [debug] Routing to a callback. [Fri Oct 12 14:02:08 2012] [debug] Nothing has been rendered,expecting delayed response.
无论我作为参数传递给’render’,都会发生这种情况.我似乎无法弄清楚如何从中获取任何有用的调试信息;但我以前没有用过Mojo.
我已经通过一些警告声明确认我的get处理程序被调用了.