I asked something similar a while back and I believe the preferred way
of including your own functions goes like this.

Put your functions in a file in your "vendors" folder. Either one will
do.
Include your file in bootstrap.php using App::import('Vendor',
'basics');

That is the most Cake-friendly way I know of.

/Martin

On Apr 16, 9:00 am, Sourabh Sharma <[EMAIL PROTECTED]> wrote:
> If You want declare the global functions for your application then you
> have create a file in parallel to bootstrap.php like
> commonfunctions.php or if you want to declare the constants for your
> application like constants.php
>
> Then you have to include the both the files in the bootstap.php  then
> you can use the function with out any constructor in any file of your
> application
>
> like if you declare a function abc() in the commonfunction and you
> have to declare the commonfunction.php in bootstarp then you have to
> use like this any file abc().
>
> if you have any confusion so please mail me at
> [EMAIL PROTECTED]
>
> Thanks & Regards
> Sourabh Sharma
>
> On Apr 16, 10:43 am, Freshow <[EMAIL PROTECTED]> wrote:
>
> > how to define a global function for all controllers in ./app/confing/
> > bootstap.php ,and how to inplement it in controller ?
>
> > :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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