Symfony2 - Class Not Found

柔情痞子 提交于 2019-12-24 01:44:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!