Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Flex] Update routing & controller chapters#8592

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 7 commits intosymfony:4.0fromweaverryan:new-routing-update
Dec 1, 2017
Merged

[Flex] Update routing & controller chapters#8592

weaverryan merged 7 commits intosymfony:4.0fromweaverryan:new-routing-update
Dec 1, 2017

Conversation

@weaverryan
Copy link
Member

More progress in updating all of the "Getting Started" guides. I will next do templating, configuration (though this has been done in#8588) and alsoservice_container, which I'd like to move into Getting Started.

Copy link
Member

@javiereguiluzjaviereguiluz left a comment

Choose a reason for hiding this comment

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

It's so nice that newer Symfony versions allow us to remove many more lines than we add when upgrading articles. I love it! Thanks for updating this.

All your PHP code lives here.

99% of the time, you'll be working in ``src/`` (PHP files) or ``config/`` (everything
Most of the time, you'll be working in ``src/`` (PHP files) or ``config/`` (everything
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should remove this phrase entirely? You now have lots of dirs to work on (templates, translations, assets, ...) It's not true that most of the time you are in src/ and config/

via ``$this->get()`` or ``$this->container->get()``. This forces you to write
more robust code to access services. But if you *do* need direct access to the
container, using ``Controller`` is fine.
What's the difference between ``Controller`` or ``AbstractController``. Not much:
Copy link
Member

Choose a reason for hiding this comment

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

There's a missing? at the end of this question.

more robust code to access services. But if you *do* need direct access to the
container, using ``Controller`` is fine.
What's the difference between ``Controller`` or ``AbstractController``. Not much:
both are identical, except that ``AbstractController`` is more restrictive: it
Copy link
Member

Choose a reason for hiding this comment

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

I don't like this AbstractController vs Controller thing :( For this introductory article is confusing and it forces the user to make a decision they cannot make at this point (because they know nothing about services and container and get(...)).

But at the same time this is probably the best place to talk about this ... so I'm really confused!

{
/**
* @Route("/lucky/number/{max}")
* @Route("/lucky/number/{max}", name="app_lucky_number")
Copy link
Member

Choose a reason for hiding this comment

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

Is thisapp_ prefix a good practice for route names? I'd never do that and it makes routes a bit long ... but if you consider it a good practice, then it's OK.

$collection = new RouteCollection();
$collection->add('blog_list', new Route('/blog', array(
'_controller' =>'AppBundle:Blog:list',
'_controller' =>[BlogController::class, 'list']
Copy link
Member

Choose a reason for hiding this comment

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

use long array syntax instead?

routing.rst Outdated
controller. Along the way, you'll learn all sorts of tricks that make mapping
even the most complex URLs easy.
configure your routes in YAML, XML or PHP, that's no problem! Just create a
new routing file (e.g. ``routing.xml``) and Symfony will automatically use it.
Copy link
Member

Choose a reason for hiding this comment

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

routing.xml ->routes.xml

routing.rst Outdated

Having flexibility is even more important. What if you need to change the
URL of a page from ``/blog`` to ``/news``? How many linksshould you need to
URL of a page from ``/blog`` to ``/news``? How many linkswoud you need to
Copy link
Member

Choose a reason for hiding this comment

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

typowoud ->would?

@weaverryanweaverryan changed the base branch frommaster to4.0December 1, 2017 03:56
@weaverryanweaverryan merged commit0cbbc28 intosymfony:4.0Dec 1, 2017
weaverryan added a commit that referenced this pull requestDec 1, 2017
This PR was squashed before being merged into the 4.0 branch (closes#8592).Discussion----------[Flex] Update routing & controller chaptersMore progress in updating all of the "Getting Started" guides. I will next do templating, configuration (though this has been done in#8588) and also `service_container`, which I'd like to move into Getting Started.Commits-------0cbbc28 fixing build errors7f0163a tweaks10563a9 Proofing the controller chapters44f2ff8 more work on getting started docs218e2d4 WIP controller chapter8b923e6 WIP controller changes89d56ea Updating routing for Flex
@weaverryanweaverryan deleted the new-routing-update branchDecember 1, 2017 03:56
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

+1 more reviewer

@ycerutoycerutoyceruto left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@weaverryan@javiereguiluz@yceruto@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp