How to include a library in Symfony
-
25-09-2019 - |
Question
I am writing an application using Symfony. I have some reusable components that I don't want to put into the main Symfony modules; instead, they are in the lib
directory.
What I want to know is, what is the best way to include this file? Can I include lib/foo/bar.php
or do I need a full path, or is there something else I should do?
Solution
I'm not an expert in Symfony, but these links should help You. Besides, because I am new to this forum, stackowerfolow lets me post just 1 link, so my second link will be explanation how to find it. ;)
Google: The Definitive Guide to symfony 1.2 (should be still relevant) . There check the chapter 17 - "Extending Symfony" under the paragraph Plugins .
OTHER TIPS
you can use this to have the lib directory
sfConfig::get('sf_lib_dir')