1 | <?php |
||
29 | class Controller |
||
30 | { |
||
31 | /** |
||
32 | * @var Application |
||
33 | */ |
||
34 | protected $application; |
||
35 | |||
36 | /** |
||
37 | * Constructor. |
||
38 | * |
||
39 | * @param Application $app |
||
40 | */ |
||
41 | public function __construct(Application $app) |
||
45 | |||
46 | /** |
||
47 | * Creates a new form. |
||
48 | * |
||
49 | * @param string $type |
||
50 | * @param mixed $data |
||
51 | * @param array $options |
||
52 | * |
||
53 | * @return FormInterface |
||
54 | */ |
||
55 | public function createForm($type, $data = null, array $options = []) |
||
59 | |||
60 | /** |
||
61 | * Gets the event dispatcher. |
||
62 | * |
||
63 | * @return EventDispatcherInterface |
||
64 | */ |
||
65 | public function getDispatcher() |
||
69 | |||
70 | /** |
||
71 | * Gets the session. |
||
72 | * |
||
73 | * @return SessionInterface |
||
74 | */ |
||
75 | public function getSession() |
||
79 | |||
80 | /** |
||
81 | * Gets the user manager. |
||
82 | * |
||
83 | * @return UserManagerInterface |
||
84 | */ |
||
85 | public function getUserManager() |
||
89 | |||
90 | /** |
||
91 | * Gets a user from the Security Token Storage. |
||
92 | * |
||
93 | * @return UserInterface|null |
||
94 | */ |
||
95 | public function getUser() |
||
110 | |||
111 | /** |
||
112 | * Generates a path from the given parameters. |
||
113 | * |
||
114 | * @param string $route The name of the route |
||
115 | * @param mixed $parameters An array of parameters |
||
116 | * |
||
117 | * @return string The generated path |
||
118 | */ |
||
119 | public function path($route, $parameters = []) |
||
123 | |||
124 | /** |
||
125 | * Redirects the user to another route. |
||
126 | * |
||
127 | * @param string $route The route to redirect to |
||
128 | * @param array $parameters An array of parameters |
||
129 | * @param int $status The status code (302 by default) |
||
130 | * |
||
131 | * @return RedirectResponse |
||
132 | */ |
||
133 | public function redirect($route, $parameters = [], $status = 302) |
||
137 | |||
138 | /** |
||
139 | * Renders a template. |
||
140 | * |
||
141 | * @param string $name The template name |
||
142 | * @param array $context An array of parameters to pass to the template |
||
143 | * |
||
144 | * @return string |
||
145 | */ |
||
146 | public function render($name, array $context = []) |
||
150 | } |
||
151 |