[symfony-users] Re: A question about placement of code in Symfony application???

2009-02-17 Thread SeeVik
Ok.never mind. I got the answer to that. Rummaging through the documentation I found out this > If you ever need to use a helper outside a template, you can still > load a helper group from anywhere by calling > sfProjectConfiguration::getActive()->loadHelpers($helpers), > where $help

[symfony-users] Re: A question about placement of code in Symfony application???

2009-02-17 Thread SeeVik
Just one more question this was keeping in mind that I want to use functions in my template. That's where helpers come in. What if I want to use some functions in controller? inside my actions? inside actions.class.php or components.class.php ? What happens then? Thanks and Regards Vikram On

[symfony-users] Re: A question about placement of code in Symfony application???

2009-02-17 Thread Eno
On Tue, 17 Feb 2009, SeeVik wrote: > Ok Alexander. > > I will try those things. Thanks a lot for your help. http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer#chapter_07_sub_helpers -- --~--~-~--~~~---~--~~ You received this message because yo

[symfony-users] Re: A question about placement of code in Symfony application???

2009-02-17 Thread Gareth McCumskey
If you are using those functions within a view they really should be helpers and should be located inside of /app/frontend/lib/helper directory and should also be named with Helper.php at the end so myFunctionsHelper.php is what they should be called. Then in the view you want to use them in you ca

[symfony-users] Re: A question about placement of code in Symfony application???

2009-02-17 Thread SeeVik
Ok Alexander. I will try those things. Thanks a lot for your help. Vikram On Feb 17, 4:46 pm, Alexandru-Emil Lupu wrote: > you might have 2 options: > insert all those stuff in some classes as static methods > either you make a Helper usually "[any of your]lib/helper/yourHelper.php" > an load

[symfony-users] Re: A question about placement of code in Symfony application???

2009-02-16 Thread Alexandru-Emil Lupu
you might have 2 options: insert all those stuff in some classes as static methods either you make a Helper usually "[any of your]lib/helper/yourHelper.php" an load it with "sfLoad::helpers(array())" if i recall right ... On Tue, Feb 17, 2009 at 4:57 AM, SeeVik wrote: > > Here are the contents

[symfony-users] Re: A question about placement of code in Symfony application???

2009-02-16 Thread SeeVik
Here are the contents of the file that I put in lib folder. /apps/$app_name/lib/myFunctions.php - wrote: > I put the file in the folder apps/$app_name/lib/ . I named the file > myFunctions.php. Yes I cleared the cache and I am u

[symfony-users] Re: A question about placement of code in Symfony application???

2009-02-16 Thread SeeVik
I put the file in the folder apps/$app_name/lib/ . I named the file myFunctions.php. Yes I cleared the cache and I am using dev controller. On Feb 17, 11:47 am, Eno wrote: > On Mon, 16 Feb 2009, SeeVik wrote: > > Yes James. I eventually found that out. Now I have created a php file > > which ac

[symfony-users] Re: A question about placement of code in Symfony application???

2009-02-16 Thread Eno
On Mon, 16 Feb 2009, SeeVik wrote: > Yes James. I eventually found that out. Now I have created a php file > which acts like a repository of functions. But the module where I am > calling these functions are not able to locate them. Is there a need > of doing some include or import or something l

[symfony-users] Re: A question about placement of code in Symfony application???

2009-02-16 Thread SeeVik
Yes James. I eventually found that out. Now I have created a php file which acts like a repository of functions. But the module where I am calling these functions are not able to locate them. Is there a need of doing some include or import or something like that? Thanks and Regards Vikram On Feb

[symfony-users] Re: A question about placement of code in Symfony application???

2009-02-16 Thread James
that is what the "lib" directory is for. If you want all applications to see them then it's sf_root_dir/lib/yourstuff If only a specific application sf_root_dir/apps/frontend/lib/yourstuff If only a specific module sf_root_dir/apps/frontend/modules/mymodule/lib/yourstuff You should read "th

[symfony-users] Re: A question about placement of code in Symfony application???

2009-02-16 Thread SeeVik
Also where can I put my classes? Like if I create some php classes and interfaces, in which folder should I place them in Symfony directory structure? Thanks and Regards Vikram On Feb 17, 9:43 am, SeeVik wrote: > hello all, > > I have a code snippet in php that I want to be accessible to all th