symfony2 bundle extension is not loaded after renaming the bundle

爷,独闯天下 提交于 2019-12-24 03:53:25

问题


I have created a new bundle called PostalAddressBundle and i created a service inside it called ss_postal_address. Everything was working fine. But i decided to rename the bundle to AddressBundle instead of PostalAddressBundle, i renamed all namespace and all things related to it. Everything is working but not the service (ss_postal_address).

I cleared the cache, but nothing happens..

this is the content of services.xml file:

 <parameters>
        <parameter key="ss_address.entity.address.class">Skonsoft\AddressBundle\Entity\Address</parameter>
        <parameter key="ss_address.form.type.address.class">Skonsoft\AddressBundle\Form\Type\AddressType</parameter>
    </parameters>

    <services>
        <service id="ss_address.form.type.address" class="%ss_address.form.type.address.class%">
            <argument>%ss_address.entity.address.class%</argument>
            <tag name="form.type" alias="ss_postal_address" />
        </service>
    </services>

Have you any idea how to fix this ?

Thank you


回答1:


I solved this problem but just removing the cache by hand:

rm -Rf ./app/cache/*

symfony cache:clear does not do the work in this case.




回答2:


Have you renamed your DI extension accordingly? For example a bundle named SkonsoftAddressBundle should have an extension named SkonsoftAddressExtension within the Skonsoft\AddressBundle\DependencyInjection namespace.



来源:https://stackoverflow.com/questions/21955276/symfony2-bundle-extension-is-not-loaded-after-renaming-the-bundle

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