2017-03-01 79 views
0

我已經完成了Sylius控制器定製的正式文檔(http://docs.sylius.org/en/latest/customization/controller.html)中描述的所有過程。但是,定義的控制器不會覆蓋默認的標準控制器。sylius控制器定製不覆蓋供應商控制器

services: 
    sylius.controller.shop.homepage: AppBundle\Controller\Shop\HomepageController 

其報告從服務一個錯誤

A service definition must be an array or a string starting with "@" but string found for service "sylius.controller.shop.homepage" in /home/xxxx/web/rude_data/app/config/services.yml. Check your YAML syntax in /home/xxxx/web/rude_data/app/config/services.yml (which is being imported from "/home/xxxx/web/rude_data/app/config/config.yml").

我是新來sylius,

所以有些教程會更好。謝謝你。

回答

0

它應該是:

sylius.controller.shop.homepage: 
     class: AppBundle\Controller\Shop\HomepageController 

而且我會建議你加入sylius鬆弛通道,那裏你可以詢問有關文件和sylius相關的問題的問題。社區真的很有幫助:)

+0

謝謝你的迴應。這真的很有幫助。控制器已被覆蓋。但我仍然遇到了問題。這是錯誤。 「類型錯誤:傳遞給AppBundle \ Controller \ Shop \ HomepageController :: __ construct()的參數1必須是Symfony \ Bundle \ FrameworkBundle \ Templating \ EngineInterface的一個實例,沒有給出。 –

+1

謝謝。我解決了它。 –