I think you need to return false.

On Tue, Jan 20, 2009 at 11:53 AM, Ron <[email protected]> wrote:
>
> I am creating a check in my app_controller beforeFilter() method and
> if the check fails I want to stop execution of the action and render a
> view.
>
> I have something like this
>
> function beforeFilter()
> {
> .....
>
> if (!$check)
> {
>   $data = array('msg'=>'my message');
>    $this->set('data', $data);
>    $this->layout = 'json';
>    $this->viewPath = 'json';
>    $this->render('index');
>    exit();
> }
>
> }//end beforeFilter()
>
> The problem is the code will not render the view, and if i take out
> the ( exit(); ) the action will go on. Any help would be appreciated.
>
> Thank You,
>
> Ronald Almeida
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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