I've searched a lot how to load/include a simple class in symfony 1.4 and i found nothing. I have this situation.
Under:
./apps/APP_NAME/
modules/MOD_NAME/lib
I have a class:
class MyClass {
function get_data(){
retrun "data";
}
}
Update: I want to load on demand, not to autoload with the convention of symfony 1.4 naming the file MyClass.class.php
Is not the best but a first version that work under module ENV is:
function load_module_lib($module, $name_file) {
require_once (sfContext::getInstance()->getModuleDirectory() . '/../' . $module . '/lib/' . $name_file . '.class.php');
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With