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 /
, , lib/vendor. symfony , , , .
config/ProjectConfiguration.class.php( ) ( ) config/autoload.yml(, ). - , .
, .
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!"