現在、html_entity_decode を使用してビューに HTML を表示しています。
<strong>Body:</strong>
<?php echo html_entity_decode($post->body); ?></p>
しかし、ビューにデータを渡すときに行う別の方法はありますか?
public function action_view($id = null)
{
$data['post'] = Model_Post::find($id);
is_null($id) and Response::redirect('Post');
$this->template->title = "Post";
$this->template->content = View::forge('post/view', $data);
}
ドキュメントを読んで試しました:
public function action_view($id = null)
{
$data['post'] = Model_Post::find($id);
is_null($id) and Response::redirect('Post');
$this->template->title = "Post";
$this->template->content = View::forge('post/view', $data);
View::$auto_encode = false;
}
しかし、これにより、「宣言されていない静的プロパティへのアクセス」が得られました。明らかに私は何か間違ったことをしている...