Skip to content

Commit 09ce5f4

Browse files
author
Allan Simon
committed
added more comments in the code
1 parent 380e488 commit 09ce5f4

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

MyApplication/src/AppBundle/Controller/ArticlesController.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@
22

33
namespace AppBundle\Controller;
44

5-
use FOS\RestBundle\Controller\FOSRestController;
6-
7-
class ArticlesController extends FOSRestController
5+
class ArticlesController
86
{
97

8+
/**
9+
* Note: here the name is important
10+
* get => the action is restricted to GET HTTP method
11+
* Article => (without s) generate /articles/SOMETHING
12+
* Action => standard things for symfony for a controller method which
13+
* generate an output
14+
*
15+
* it generates so the route GET .../articles/{id}
16+
*/
1017
public function getArticleAction($id)
1118
{
1219
return array('hello' => 'world');
1320
}
14-
1521
}
16-
17-

0 commit comments

Comments
 (0)