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

Rendering a Template example lists non-new use statement as "new" #5969

Closed
dangoodspeed opened this issue Dec 6, 2015 · 3 comments
Closed
Labels
hasPR A Pull Request has already been submitted for this issue.

Comments

@dangoodspeed
Copy link

In the example on
http://symfony.com/doc/current/book/page_creation.html#rendering-a-template-with-the-service-container

It says
// --> add this new use statement
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

When it's not a new use statement. I'm a beginner reading through the docs, but I think it's the wrong use statement.

@ogizanagi
Copy link
Contributor

Actually, I would rather say that the previous examples extend the Controller class and thus have this use statement too soon.

The shown controller should only extends the base Symfony\Bundle\FrameworkBundle\Controller\Controller one in the "Rendering a Template (with the Service Container)" section IMO.

I suggest to remove any usage of the base Controller class before introducing the container on this book.

@dangoodspeed
Copy link
Author

Took me a while to figure out what @ogizanagi meant (I'm a beginner), but yes I agree... removing all mentions of
use Symfony\Bundle\FrameworkBundle\Controller\Controller; and extends controller from the LuckyClass for the first five sample codes on the page_creation site would make the learning process a bit easier for those new to Symfony like myself.

@ogizanagi
Copy link
Contributor

@dangoodspeed : I've suggested those changes in the above PR. Thanks !

@xabbuh xabbuh added the hasPR A Pull Request has already been submitted for this issue. label Dec 8, 2015
xabbuh added a commit that referenced this issue Dec 9, 2015
…ng it (ogizanagi)

This PR was merged into the 2.3 branch.

Discussion
----------

[Book] Do not extend the base controller before introducing it

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3+
| Fixed tickets | #5969

Commits
-------

98c4525 [Book] Do not extend the base controller before introducing it
@xabbuh xabbuh closed this as completed Dec 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hasPR A Pull Request has already been submitted for this issue.
Projects
None yet
Development

No branches or pull requests

3 participants