-
Notifications
You must be signed in to change notification settings - Fork 283
Conversation
@@ -17,7 +17,7 @@ | |||
{ | |||
{% block method_body %} | |||
$deleteForm = $this->createDeleteForm(${{ entity_singularized }}); | |||
$editForm = $this->createForm(new {{ entity_class }}Type(), ${{ entity_singularized }}); | |||
$editForm = $this->createForm({{ entity_class }}Type::class, ${{ entity_singularized }}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this does not work in PHP versions before 5.5. To be on the safe side you should probably rather use the FCQN instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for FQN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a check if php > 5.3 is installed or something like this or an option in the commands?
@@ -43,7 +43,7 @@ public function configure() | |||
inside bundles. Provide the bundle name as the first argument and the command | |||
name as the second argument: | |||
|
|||
<info>php app/console generate:command AppBundle blog:publish-posts</info> | |||
<info>php bin/console generate:command AppBundle blog:publish-posts</info> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the app/
to bin/
changes must be reverted as we support both 2.x and 3.x dir structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
hi, just gave a try for this solution, and works great. But when generating a crud for a bundle living in a vendor name, there is a \ missing between the vendor name and the bundle name for new and edit action. not sure that am clear. e.g For a bundle CompanyBundle in the folder /src/IKNSA/CompanyBundle/Controller/CompanyController.php
There is a backslash missing between IKNSA and CompanyBundle |
@@ -17,7 +17,7 @@ | |||
{ | |||
{% block method_body %} | |||
$deleteForm = $this->createDeleteForm(${{ entity_singularized }}); | |||
$editForm = $this->createForm(new {{ entity_class }}Type(), ${{ entity_singularized }}); | |||
$editForm = $this->createForm('\{{ bundle }}\Form\{{ entity_class }}Type', ${{ entity_singularized }}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The leading \
is not needed, same below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, bundle
references the bundle name, not the bundle namespace.
It should work fine. |
Tested again and it works fine |
Thank you @jpyzio. |
After resolve action problems, there was problems in views, crud generete for example:
In client/index.html.twig:
insted:
It was fixed too in commit.