8000 Update business-logic.rst · symfony/symfony-docs@a5d2304 · GitHub
[go: up one dir, main page]

Skip to content

Commit a5d2304

Browse files
authored
Update business-logic.rst
previous example didn't show the usage of service passed via argument but fetching via $this->get.
1 parent d256bb7 commit a5d2304

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

best_practices/business-logic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Now you can use the custom slugger in any controller class, such as the
121121
// $slugger = $this->get('app.slugger');
122122
123123
if ($form->isSubmitted() && $form->isValid()) {
124-
$slug = $this->get('app.slugger')->slugify($post->getTitle());
124+
$slug = $slugger->slugify($post->getTitle());
125125
$post->setSlug($slug);
126126
127127
// ...

0 commit comments

Comments
 (0)
0