include file in action.class.php ? symfony
i have library in file Example.php. I would like this include for action.class.php. How can i 开发者_如何学Cmake this? In template i can make partial and use include_partial, but how can make somethings in action?
An easy - and symfony like - way would be to make a class file and store it in the lib directory, so the symfony autoloader will provide them all over your project.
Example.class.php :
Class Example {
static public function myFoo(){
return true;
}
}
actions.class.php :
public function executeFoo($request){
/* snip */
$this->foo = Example::myFoo();
/* snip */
}
精彩评论