Have a look at Object::cakeError(), which, in turn, invokes Error.php
You can use it in your controller something like this:

$opts = array(
        'name' => 'Not found',
        'code' => 404,
        'message' => 'Your message here',
        'base' => $this->base
);

$this->cakeError('error', array($opts));

I have no idea why a nested array is necessary. It's all a bit
confusing. And, like most Cake classes, documentation is scarce.

On Tue, Jul 1, 2008 at 2:40 PM, theandystratton
<[EMAIL PROTECTED]> wrote:
>
> Hey guys,
>
> I'm using my own version of a pages controller with routes to the
> display() method, that's basically handling the layout/view rendering
> via switch statement:
>
> <?php
> //
> //Rroutes are similar to: /terms => /pages/display/terms
> //
> switch ( func_get_arg(0) ) {
>    case 'terms':
>        $this->layout = 'terms';
>        $this->pageTitle = 'Terms and Conditions';
>        break;
>
>    default:
>        //
>        // HELP!
>        //
>        break;
> }
> ?>
>
> In the commented section is where I'd like to be able to redirect/
> throw a 404 error. I have no clue how to do this with Cake, could
> someone please point my in the right direction?
>
> thx,
>
> -A
> >
>

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

Reply via email to