I'm handling 404s with the line CHttpException(404, $message), and the $message variable is an HTML string to achieve some styling. But CHttpException() encodes my $message, rendering the HTML as a useless escaped string. Is there any way around the string encoding of CHttpException, in order to output HTML?
/**
* From PostsController.php
*/
// ...
public function actionCategory($id)
{
$categoryModel = Categories::model()->findByAttributes(array('idCategory'=>$id));
if($categoryModel===null){
$message = "<div class=\"alert alert-danger\">Page Not Found</div>";
throw new CHttpException(404, $message);
return;
}
// ...