我正在尝试使用我的控制器呈现模板,但它不起作用,它向我显示此错误:
LogicException:控制器必须返回响应(
你好鲍勃!
给定)。在 Symfony\Component\HttpKernel\HttpKernel->handleRaw() (core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php 的第 163 行)。
我的功能:
public function helloAction($name) {
$twigFilePath = drupal_get_path('module', 'acme') . '/templates/hello.html.twig';
$template = $this->twig->loadTemplate($twigFilePath);
return $template->render(array('name' => $name));
}