1
我是新來的symfony,也許我錯過了一些非常簡單的東西,但我無法發現它。任何幫助都感激不盡。我有這兩個文件:symfony控制器類沒有找到
C:\ XAMPP \ htdocs中\的Symfony的\ src \ Apps01 \ ResourceCalBundle \資源\ CONFIG \ routing.yml中
ResourceCalendar_Login:
pattern: /resourcecalendar/login
defaults: { _controller: AppsRollerResourceCalBundle:Login:DisplayLogin }
C:\ XAMPP \ htdocs中\的Symfony的\ src \ Apps01 \ ResourceCalBundle \控制器\ LoginController.php
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
class LoginController
{
public function DisplayLoginAction()
{
return new Response('<html><body>Hello There!</body></html>');
}
}
然而,當我指出我的瀏覽器http://example.com/Symfony/web/app_dev.php/resourcecalendar/login我得到以下錯誤:
The autoloader expected class "Apps01\ResourceCalBundle\Controller\LoginController" to be defined in file "C:\xampp\htdocs\Symfony/src/\Apps01\ResourceCalBundle\Controller\LoginController.php". The file was found but the class was not in it, the class name or namespace probably has a typo.
500 Internal Server Error - RuntimeException
有人可以指出我錯過了什麼,當我看到類LoginController
肯定存在於文件管理器內?
感謝 鋁
謝謝,就是這樣。我試圖通過文檔,但沒有抓住它。 – la6470