Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Use statement Template #570

Closed
wants to merge 3 commits into from
Closed

Use statement Template #570

wants to merge 3 commits into from

Conversation

SimonVanherweghe
Copy link
Contributor

[Semantical Error] The annotation "@template" in method Acme\BasicCmsBundle\Controller\DefaultController::pageAction() was never imported. Did you maybe forget to add a "use" statement for this annotation?
Yes we did :-)

Also, running http://localhost:8000/page/home for the first time didn't work. I got an error about routes and the /Document/Page
The error was on line 6 on the page.html.twig file, without {{ path( post) }} it worked. Very strange, suddenly it worked. Some caching stuff?
(sorry, I don't have the exact error message, I can't reproduce it anymore)

[Semantical Error] The annotation "@template" in method Acme\BasicCmsBundle\Controller\DefaultController::pageAction() was never imported. Did you maybe forget to add a "use" statement for this annotation?
Yes we did :-)

Also, running http://localhost:8000/page/home for the first time didn't work. I got an error about routes and the /Document/Page
The error was on line 6 on the page.html.twig file, without {{ path( post) }} it worked. Very strange, suddenly it worked. Some caching stuff?
(sorry, I don't have the exact error message, I can't reproduce it anymore)
@wouterj
Copy link
Member

wouterj commented Sep 21, 2014

If you had followed the complete tutorial from page 1, you had created the bundle using:

$ php app/console generate:bundle --namespace=Acme/BasicCmsBundle --dir=src --no-interaction

In this case, the format is defaulted to "annotation" and you'll get this use statement in your default controller automatically.

However, now I don't think we can assume people are reading the complete tutorial. So +1 for this change.

Could you please add a new line between the use statement and the controller, after that we can merge it imo.

@dbu
Copy link
Member

dbu commented Sep 21, 2014

+1 for "redundancy" in this case.

@SimonVanherweghe
Copy link
Contributor Author

I've read the whole tutorial, but I prefer the yaml configuration, see:
#568
and
https://github.com/DoneBySimon/CmfTutorial

I've added the new line between the use statement and the controller

@@ -97,8 +97,10 @@ Now create the action in the default controller - you can pass the ``Page``
object and all the ``Posts`` to the view::

// src/Acme/BasicCmsBundle/Controller/DefaultController.php

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry to say but this should not have unneeded blanks here. can you fix that and then squash your commits?

(i configure my editors to remove all trailing whitespace on save)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, I'm confused: #577 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've added spaces on an empty line. You should remove the spaces, but keep the blank line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aah ok, I wasn't aware, sorry

@dbu dbu mentioned this pull request Sep 26, 2014
@dbu
Copy link
Member

dbu commented Sep 26, 2014

thanks a lot. i squashed the commits and removed another case of unnecessary blanks in 7ae794b, then merged manually.

@dbu dbu closed this Sep 26, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants