Skip to content

Fix a diff example in Page Creation article #18503

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

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,21 @@ so that the ``number()`` method is called when a user browses to it. This associ
is defined with the ``#[Route]`` attribute (in PHP, `attributes`_ are used to add
metadata to code):

.. configuration-block::

.. code-block:: php-attributes
.. code-block:: diff

// src/Controller/LuckyController.php
// src/Controller/LuckyController.php

// ...
+ use Symfony\Component\Routing\Annotation\Route;
// ...
+ use Symfony\Component\Routing\Annotation\Route;

class LuckyController
{
+ #[Route('/lucky/number')]
public function number(): Response
{
// this looks exactly the same
}
}
class LuckyController
{
+ #[Route('/lucky/number')]
public function number(): Response
{
// this looks exactly the same
}
}

That's it! If you are using Symfony web server, try it out by going to: http://localhost:8000/lucky/number

Expand Down