I have a Symfony 2.2 project with just one app called "Xedef". Inside that app folder, I've created a Model
directory with some classes in it. I was hoping I could just define a namespace for that classes as declaring the namespace as:
namespace Xedef\Model;
class MyClass
{
// ...
}
And then use them from, let's say, my controler just by "using" that namespaces as:
use Xedef\Model\MyClass;
class HomeController extends Controller
{
public function welcomeAction()
{
$myObj = new MyClass();
}
}
But I had no luck. This results in the following error:
FatalErrorException: Error: Class 'Xedef\Model\MyClass' not found in /gitRepo/XedefApp/src/Xedef/MainBundle/Controller/HomeController.php
Oddly, I did this same thing in Sf 2.1 and I hadn't any troubles. Did something changed in 2.2?