我最近開始學習symfony 2.8並嘗試在本地主機上設置第一頁。基於本教程配置我的包後,但是:https://www.youtube.com/watch?v=S9aQxvEAdcE&list=PLp9j56Yo8a6aWJhLyggonvP7b8vIcYn5Q&index=3CheckExceptionOnInvalidReferenceBehaviorPass.php中的ServiceNotFoundException第58行
我得到這個錯誤:
ServiceNotFoundException in CheckExceptionOnInvalidReferenceBehaviorPass.php line 58:
The service "doctrine.orm.layout_entity_manager" has a dependency on a non-existent service "doctrine.orm.quote_strategy.layout".
嘗試與本地主機ADRESS打開我的頁面時,
/ST /網絡/ app_dev.php
原因我問的是,這是無法找到關於這個特定問題的任何事情,並不知道這些服務是關於什麼。如果任何人有任何線索我做錯了或爲什麼會出現此錯誤,請與我分享。我不添加任何代碼,因爲我不太確定哪些文件可能是此錯誤的原因。在此先感謝
編輯:
我使用PHP風暴位於C:\wamp64\www\st
(啓用symfony的插件和命令行工具)創建新的symfony項目
然後生成一個名爲MainBundle
我重新命名包DefaultController.php
在MainBundle/Controller
到MainController.php
並將其中的等級更改爲MainController
。 然後在app/Resources/views
重命名默認文件夾layout
,以及base.html.twig
到layout.html.twig
然後填充自舉模板樹枝文件
然後換MainController.php到這一點:
<?php
namespace MainBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class MainController extends Controller
{
/**
* @Route ("/", name="home")
*/
public function indexAction()
{
return $this->render('MainBundle:Default:home.html.twig');
}
}
然後在src/Resource/views/Defaul
噸變化index.html.twig
變成home.html.twig
src/MainBundle/Resources/config/routing.yml
填入像這樣:
main:
resource: "@MainBundle/Controller/MainController.php"
prefix: /
type: annotation
加入GitHub的項目鏈接https://github.com/marras1/st
你會採取什麼行動來產生這個錯誤?爲什麼不把所有文件轉儲到github項目並從這裏鏈接到它?或者嘗試將您的代碼縮小到展示問題的最小事物,然後在此處發佈。沒有看到任何代碼就很難調試你的問題。 –
@WillSheppard編輯了更多的細節問題,並添加github鏈接發佈。希望能夠明白理解 – marras