Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make:crud - error of naming twig varible in index method #134

Closed
s0lar opened this issue Mar 16, 2018 · 2 comments
Closed

make:crud - error of naming twig varible in index method #134

s0lar opened this issue Mar 16, 2018 · 2 comments

Comments

@s0lar
Copy link

s0lar commented Mar 16, 2018

My Entity name is "App\Entity\DepartmentPo"
After make:crud in controller a get method

App\Controller\DepartmentPoController.php

    public function index(DepartmentPoRepository $departmentPoRepository): Response
    {
        return $this->render('department_po/index.html.twig', ['departmentPos' => $departmentPoRepository->findAll()]);
    }
templates\department_po\index.html.twif

    {% for department_po in department_pos %}

In the controller defines "departmentPos" varible but in twig we trying find "department_pos".
I think the problem in the entity name "DepartmentPo".

sadikoff added a commit to sadikoff/maker-bundle that referenced this issue Mar 17, 2018
@weaverryan
Copy link
Member

Will be fixed in #132 :)

weaverryan added a commit that referenced this issue Mar 17, 2018
This PR was squashed before being merged into the 1.0-dev branch (closes #132).

Discussion
----------

make:crud skeleton optimization

Lets start from `Controller::delete` action. I don't think we need 2 return statements here.

Maybe it will be better to add some flash messages?

Commits
-------

97841c1 simplify CrudControllerWebTest (we need only check if index works)
43ce972 added tests for crud generation with entity repository
4d1e2d8 fixing #134
1f4455e skeleton template Controller optimization
@weaverryan
Copy link
Member

Let us know if you have any other issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants