Thanks for the advice cricket.

I decided to set up some default settings in bootstrap, achieved this using
array_merge.

function _someFunction($options=array()) {
    $defaults=array('someKey' => Configure::read('SomeKey'), ...);
    $options = array_merge($defaults, $options);
    ...
}

I figure it shouldn't be to hard for anybody who might take over in the
future to figure out what's going on.

Cheers
 Stephen


On 9 November 2010 18:39, cricket <[email protected]> wrote:

> 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]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

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