【发布时间】:2011-05-30 05:46:54
【问题描述】:
我创建了一个函数来获取用户收件箱消息并使用“user-profile-messages”模板显示它。 如果用户单击删除所有按钮,我还添加了删除批量收件箱消息的功能(在同一功能中)。 但是在删除所有消息后,页面/模板不会重新渲染。请告诉我可能是什么原因。
我正在使用以下方法渲染页面。
$this->template->body = View::factory("user-profile-messages", array(
"msg" => $msg,
"messages" => $messages,
))->render();
我正在使用 Kohana 最新版本。
【问题讨论】:
-
您是否在模板视图中
echoing$body? -
没有。我正在使用 View::factory()->render() 方法来显示模板。
-
render()只是将 View 对象转换为字符串。 Alex 表示您需要在$this->template视图中的某处显示$bodyvar。