Skip to content

Commit 58feabe

Browse files
authored
Update readme.md
1 parent 14de5c0 commit 58feabe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

readme.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ class FooController extends AppController
6363
{
6464
$this->set('results', $this->Articles->getListingForUser(
6565
$this->Auth->user('id')
66-
$this->request
66+
$this->getRequest()->getQueryParams()
6767
));
6868
}
6969
}
7070
```
7171

7272
If there is already a property with the name of the service used in the controller a warning will be thrown. In an ideal case your controller won't have to use any table instances anyway when using services. The tables are not a concern of the controller.
7373

74+
The advantage of the above code is that the args passed to the service could come from shell input or any other source. The logic isn't tied to the controller nor the model. Using proper abstraction, the underlying data source, a repository that is used by the service, should be transparently replaceable with any interface that matches the required implementation.
75+
7476
For details see **[docs](/docs)**.
7577

7678
## Why no DI container?

0 commit comments

Comments
 (0)