Reputation: 21
I try to rename an Symfony Bundle. My Installation is 3.4 and Standart.
Installed symfony-installer and Generate AppBundle.
Now i has modified the AppBundle, and all works Nice!
Next Step to try is rename AppBundle to TestBundle.
I have changed src/AppBundle/AppBundle.php
into src/TestBundle/TestBundle.php
Then opened it an Change the Namespace to TestBundle and the classname also.
In AppKernel chage:
new AppBundle/AppBundle()
To:
new TestBundle/TestBundle()
The TestBundle will Not be called. I have insertet an
die("called!!!")
Into TestBundle. So i doesnt have to change anymore, i should see "called!!!".
But i See:
Attempted to load class "TestBundle" from namespace "TestBundle". Did you forget a "use" statement for another namespace?
What have i to do??
Thanks!!!
Upvotes: 1
Views: 768
Reputation: 531
Check you're namespace in file -> AppBundle.php
, change to TestBundle, and rename you file to TestBundle.php
.
Then chack settings in config/routing.yml
defaults: { _controller: TestBundle:ControllerName:ActionName }
Upvotes: 1