1 | <?php |
||
18 | class AdminController extends Controller |
||
19 | { |
||
20 | /** |
||
21 | * @Method("GET") |
||
22 | * @Route("/", name="mainAdmin") |
||
23 | * @Template("AppBundle:admin:main.html.twig") |
||
24 | * |
||
25 | * @return Response |
||
26 | */ |
||
27 | 1 | public function indexAction() |
|
28 | { |
||
29 | 1 | $em = $this->getDoctrine()->getManager(); |
|
30 | 1 | $countArticles = $em->getRepository("AppBundle:Article") |
|
31 | 1 | ->getCountArticles(); |
|
32 | |||
33 | 1 | $countComments = $em->getRepository("AppBundle:Comment") |
|
34 | 1 | ->getCountComments(); |
|
35 | |||
36 | 1 | $countUsers = $em->getRepository("AppBundle:User") |
|
37 | 1 | ->getCountUsers(); |
|
38 | |||
39 | return [ |
||
40 | 1 | 'countArticles' => $countArticles['countArticles'], |
|
41 | 1 | 'countComments' => $countComments['countComments'], |
|
42 | 1 | 'countUsers' => $countUsers['countUsers'], |
|
43 | 1 | ]; |
|
44 | } |
||
45 | |||
46 | /** |
||
47 | * @Route("/success", name="successAdmin") |
||
48 | * @Template("AppBundle:blog:success.html.twig") |
||
49 | * |
||
50 | * @return Response |
||
51 | */ |
||
52 | public function successAction() |
||
56 | |||
57 | } |
||
58 |