问题
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