I need to load a class in Symfony 1.4 but the simple placing of the file in /apps/frontend/lib seems not to be enough.
class test
{ function foo ($foo) { echo $foo; }
}
and I tried to use it in an action:
public function executeTest(sfWebRequest $request)
{
$a = new test();
$a->foo('aaa');
}
I have refreshed the cache and still:
Fatal error: Class 'test' not found in ...
Do I have to declare it somewhere?
You have to place your file in your project lib folder:
[Updating]
About loading a class from a file in
myproject/apps/frontend/lib/maybe the problem is the filename where is the class.I found in this page A Gentle Introduction to symfony – Chapter 2 – Exploring Symfony’s Code that: