How to create / use custom classes and helper in symfony 1.4?

What is the best way to put a custom library or helper methods in symfony? I use the doctrine with my project. One place that I think is positive is under

project_root / lib / vendor / MyClasses /
But if I want to create a class or helper function that will use some of the basic symfony / doctrine methods and return the result, then how to do it and where to put it? I want it to call from different modules to avoid code duplication.
+5
source share
2 answers

, , lib/vendor. symfony , , , .

config/ProjectConfiguration.class.php( ) ( ) config/autoload.yml(, ). - , .

+7

, .

symfony 1.2 " " docs:

( PHP, HTML-) FooBarHelper.php, FooBar - . apps/myapp/lib/helper/( /, / ), use_helper ('FooBar') ,

, FooBar foo(), lib/helper/FooBarHelper.php:

function foo() {echo "foo!"; }

:

use_helper('FooBar')
....

foo(); //outs "foo!"
+2

All Articles