On Apr 15, 2011, at 01:48, thom wrote:
> Hello, I want to create some functions and want to able to call it
> every where (Controller/ View). How could I do that? Where I have to
> place it?
CakePHP is object-oriented, thus you would be encouraged to create a class and
a method inside it, not a bare function. To create a class you can use from
anywhere, put a file in APP/libs (for example my_class.php), make a class in it
(like "class MyClass"), and then import it wherever you want to use it (using
"App::Import('Lib', 'MyClass');").
If you insist on creating a function, not a class, then you could do it in any
central file, such as config/bootstrap.php.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php