Skip to content

Commit

Permalink
minor #12338 [DOCS] Updating the controller customization (Roshyo)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.9 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | 1.9
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no (but fixing one :D )
| Related tickets | N/A
| License         | MIT

* Fix the last route declaration to its real use
* Use the term `make sure` instead of `check if` since it is should to work
* use the double `:` syntax for controllers instead of the deprecated single `:`


Commits
-------

f1028ab Updating the controller customization doc
4f6b2de Update docs/customization/controller.rst
  • Loading branch information
GSadee committed Feb 12, 2021
2 parents a80635f + 4f6b2de commit 75f6899
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/customization/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ getting a list of recommended products from your external api.
.. tip::

Run ``php bin/console debug:container sylius.controller.product`` to check if the class has changed to your implementation.
Run ``php bin/console debug:container sylius.controller.product`` to make sure the class has changed to your implementation.

**4.** Finally you’ll need to add routes in the ``config/routes.yaml``.

Expand All @@ -124,7 +124,7 @@ getting a list of recommended products from your external api.
path: /product/show
methods: [GET]
defaults:
_controller: sylius.controller.product:showAction
_controller: sylius.controller.product::showAction
How to customize a Standard Controller?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -175,22 +175,22 @@ If you still need the methods of the original ``HomepageController``, then copy
services:
sylius.controller.shop.homepage:
class: App\Controller\Shop\HomepageController
arguments: ['@twig']
autowire: true
tags: ['controller.service_arguments']
.. tip::

Run ``php bin/console debug:container sylius.controller.shop.homepage`` to check if the class has changed to your implementation.
Run ``php bin/console debug:container sylius.controller.shop.homepage`` to make sure the class has changed to your implementation.

**3.** Finally you’ll need to add routes in the ``config/routes.yaml``.

.. code-block:: yaml
app_shop_custom_product:
path: /custom/product
app_shop_custom_action:
path: /custom
methods: [GET]
defaults:
_controller: sylius.controller.product:showAction
_controller: sylius.controller.shop.homepage::customAction
From now on your ``customAction`` of the ``HomepageController`` will be available alongside the ``indexAction`` from the base class.

Expand Down

0 comments on commit 75f6899

Please sign in to comment.