Friday, August 27, 2010

$this->cakeError("error401") won't render my error401.ctp

Hi all

I want to display a 401 error, so I created an app/app_error.php file
with the following content:

<?php

class AppError extends ErrorHandler {
function error401() {

}
}

?>

And I created a view app/views/errors/error401.ctp with the following
content:

<h2><?php echo $name; ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__("You are not authorized to %s.", true),
"<strong>'{$message}'</strong>")?>
</p>

Then I call the error using:

$this->cakeError("error401");

But I'm still getting the default 401 error... (or at least not my
own!)

What could be the problem here?

Thanks a lot for help
Josh

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: