render = $render; } public function index(ResponseInterface $response) { $render = ApplicationContext::getContainer() ->get(\Hyperf\View\RenderInterface::class); return $render->render('index', [ 'title' => 'Smarty示例', 'message' => '欢迎使用Hyperf+Smarty', 'show_additional' => true, 'additional' => '这是通过Smarty渲染的内容' ]); } }