From the course: PHP: Design Patterns

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Exploring a use case for the Action-Domain-Response pattern

Exploring a use case for the Action-Domain-Response pattern - PHP Tutorial

From the course: PHP: Design Patterns

Start my 1-month free trial

Exploring a use case for the Action-Domain-Response pattern

- This before example should look familiar if you've already watched the MVC videos. This is a basic, traditional MVC. We have views which handle the HTML. We have models which keep all the model data. And we have controllers which tie them all together. Check out the MVC video if you need a deeper understanding of this code or how it's structured. In the after is where things get quite a bit more interesting and complicated. So we're going to step through this piece by piece. First we have the views, which are unchanged, but have moved to a directory called templates to clearly identify what they are. Next, the models that we have before are also unchanged, but have moved to a directory called domains. None of our business logic has changed. The first big change are the actions. Previously, controllers had a different method for each operation. With actions, we have a separate class for each operation. I mean that quite literally. If you have a domain called project, you'll have a…

Contents