Passed
Push — master ( 5f442d...5e8f10 )
by Žilvinas
03:02
created

TemplatingController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 53
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A includesAction() 0 9 1
A includesWithNoContextAction() 0 9 1
A forLoopAction() 0 20 1
1
<?php
2
namespace AppBundle\Controller;
3
4
use AppBundle\Entity\Task;
5
use AppBundle\Form\TaskType;
6
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7
use Symfony\Component\Form\Extension\Core\Type\DateType;
8
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
9
use Symfony\Component\Form\Extension\Core\Type\TextType;
10
use Symfony\Component\HttpFoundation\Request;
11
use Symfony\Component\Routing\Annotation\Route;
12
13
/**
14
 * @Route("/templating")
15
 */
16
class TemplatingController extends Controller
17
{
18
    /**
19
     * @Route("/includes", name="templating_includes")
20
     */
21
    public function includesAction()
22
    {
23
        return $this->render(
24
            'templating/includes.html.twig',
25
            [
26
                'name' => 'Raccoon'
27
            ]
28
        );
29
    }
30
31
    /**
32
     * @Route("/includes/with-no-context", name="templating_includes_with_no_context")
33
     */
34
    public function includesWithNoContextAction()
35
    {
36
        return $this->render(
37
            'templating/includes-with-no-context.html.twig',
38
            [
39
                'name' => 'Raccoon'
40
            ]
41
        );
42
    }
43
44
    /**
45
     * @Route("/for-loop", name="templating_for_loop")
46
     */
47
    public function forLoopAction()
48
    {
49
        return $this->render(
50
            'templating/for-loop.html.twig',
51
            [
52
                'list' => [
53
                    'one',
54
                    'two',
55
                    'three',
56
                    'four',
57
                    'five',
58
                    'six',
59
                    'seven',
60
                    'eight',
61
                    'nine',
62
                    'ten'
63
                ]
64
            ]
65
        );
66
    }
67
68
}