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

Appearance settings

[DX] ADR usage #8153

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

Closed
wants to merge 29 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c8050b1
Adding the ADR approach.
Guikingone Jul 14, 2017
0d0d4cc
Update service.rst
Guikingone Jul 14, 2017
7359837
Update service.rst
Guikingone Jul 14, 2017
885e696
Update service.rst
Guikingone Jul 14, 2017
220021e
Update service.rst
Guikingone Jul 14, 2017
1fda263
Update service.rst
Guikingone Jul 14, 2017
11c77c7
Update service.rst
Guikingone Jul 14, 2017
d21feb2
Update service.rst
Guikingone Jul 15, 2017
a449220
Update service.rst
Guikingone Jul 17, 2017
6d1ed62
Update service.rst
Guikingone Jul 17, 2017
a81b625
Update service.rst
Guikingone Aug 3, 2017
8444e98
Added the dedicated file and link from service.rst
Guikingone Aug 3, 2017
a93fa6c
Update adr.rst
Guikingone Aug 3, 2017
97bcbac
Update adr.rst
Guikingone Aug 3, 2017
72c2c74
Update service.rst
Guikingone Aug 3, 2017
666a89f
Update adr.rst
Guikingone Aug 3, 2017
c8625fb
Update adr.rst
Guikingone Aug 5, 2017
0d2022a
Corrected the index typo.
Guikingone Aug 5, 2017
582f4bf
Update adr.rst
Guikingone Aug 5, 2017
a237312
Update adr.rst
Guikingone Aug 6, 2017
cd46501
Update adr.rst
Guikingone Aug 16, 2017
24416f5
Update adr.rst
Guikingone Sep 12, 2017
dc6ddc6
Update adr.rst
Guikingone Oct 16, 2017
f1aad20
Update adr.rst
Guikingone Oct 16, 2017
16c8472
Update adr.rst
Guikingone Oct 16, 2017
eca9a0a
[ADD](Responder classe)[!P2]
Guikingone Nov 24, 2017
aa0a207
[FIX](Syntax)[!P2]
Guikingone Nov 24, 2017
551aed6
[FIX](ADR Repository)[!P2]
Guikingone Nov 24, 2017
3dacc68
fix(typo): fix on typo and space.
Guikingone Jan 24, 2018
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
Prev Previous commit
Next Next commit
Corrected the index typo.
  • Loading branch information
Guikingone committed Aug 5, 2017
commit 0d2022ad3cc9ce5a75ef1265fb0ddb5ff3ebda9c
8 changes: 4 additions & 4 deletions 8 controller/adr.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.. index::
single: Action Domain Responder approach
single: Action Domain Responder approach

How to implement the ADR pattern
================================

In Symfony, you're used to implement the MVC pattern and extending the default :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller`
Copy link
Member

Choose a reason for hiding this comment

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

Symfony has never promoted the MVC pattern (at least, not since version 2). Instead, we are presenting Symfony as being a Request/Response framework where the controller converts a Request to a Response via a Controller.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, my apologies for this words, the meaning of my "text" was to clearly say that a lot of developers use Symfony with MVC and that using this pattern is way more used than just transforming a Request into Response (which is handled by the framework in a certain way, the actual transformation occurs in the controller).

class.
class.
Since the 3.3 update, Symfony is capable of using natively the ADR approach.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it is worth it to add a link to https://github.com/pmjones/adr


Updating your configuration
Expand Down Expand Up @@ -109,7 +109,7 @@ Once this is done, you can define the routes like before using multiples approac

// app/config/routing.php
use AppBundle\Action\HelloAction

$collection->add('hello', new Route('/hello', array(
'_controller' => HelloAction::class,
)));
Expand Down Expand Up @@ -156,7 +156,7 @@ Like you can easily imagine, the :class:`Symfony\\Component\Httpfoundation\Reque
public function __invoke() : Response
{
$data = $this->requestStack->getCurrentRequest()->get('id');
Copy link
Contributor

Choose a reason for hiding this comment

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

$data is not used, you should at least pass it to the view.


return new Response($this->twig->render('default/index.html.twig', array('data' => $data));
Copy link
Contributor

Choose a reason for hiding this comment

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

i think PHP7 is assumed in the doc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think we should use the [] syntax?

}
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.