On Tue, Nov 9, 2010 at 4:14 AM, Stephen <[email protected]> wrote:
> Hi there,
>
> This is my first time on the mailing list however I'm a big fan of CakePHP.
>
> I'm wondering what is the best way of displaying error messages to the
> developer.
>
> I have a private function in my AppController which contains quite a few
> required parameters and an options array, I wish to display an error to the
> developer without redirecting or interrupting anything if the required
> parameters are left blank. The ErrorHandler seems to render a new file on
> error so I decided not to use this, I only want this error to display if
> debug is set to either 1, 2 or 3.

Use the debug() function. It will only display something if 'debug' is
set to non-zero.

Alternatively, your application can check Configure::read('debug') in
order to decide what to do.

But the best approach would probably be to add logic to either
gracefully handle empty params, or stop them from being sent empty in
the first place.

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