[!!!][TASK] Use correct ISO8601 format
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Mvc / View / ViewInterface.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Mvc\View;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Interface of a view
19 *
20 * @api
21 */
22 interface ViewInterface
23 {
24 /**
25 * Sets the current controller context
26 *
27 * @param \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext
28 * @return void
29 */
30 public function setControllerContext(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext);
31
32 /**
33 * Add a variable to the view data collection.
34 * Can be chained, so $this->view->assign(..., ...)->assign(..., ...); is possible
35 *
36 * @param string $key Key of variable
37 * @param mixed $value Value of object
38 * @return \TYPO3\CMS\Extbase\Mvc\View\ViewInterface an instance of $this, to enable chaining
39 * @api
40 */
41 public function assign($key, $value);
42
43 /**
44 * Add multiple variables to the view data collection
45 *
46 * @param array $values array in the format array(key1 => value1, key2 => value2)
47 * @return \TYPO3\CMS\Extbase\Mvc\View\ViewInterface an instance of $this, to enable chaining
48 * @api
49 */
50 public function assignMultiple(array $values);
51
52 /**
53 * Tells if the view implementation can render the view for the given context.
54 *
55 * @param \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext
56 * @return bool TRUE if the view has something useful to display, otherwise FALSE
57 * @api
58 */
59 public function canRender(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext);
60
61 /**
62 * Renders the view
63 *
64 * @return string The rendered view
65 * @api
66 */
67 public function render();
68
69 /**
70 * Initializes this view.
71 *
72 * @return void
73 * @api
74 */
75 public function initializeView();
76 }