问题
I have added custom class under /src/Common
directory as described here I do everything as described in link but it doesn't work. I can't understand why. Thank you in advance for help.
Custom Class: HttpClient.class.php
namespace Common;
class HttpClient {...
Controller:
use Common\HttpClient;
$httpClient = new HttpClient();
Error:
FatalErrorException: Error: Class 'Common\HttpClient' not found in ...
回答1:
Problem is my class exstension. It was .class.php
and I changed it to .php
and everything works now.
来源:https://stackoverflow.com/questions/19652384/symfony2-class-not-found