1<?php
2namespace TYPO3Fluid\Fluid\View;
3
4/*
5 * This file belongs to the package "TYPO3 Fluid".
6 * See LICENSE.txt that was shipped with this package.
7 */
8
9/**
10 * Interface of a view
11 *
12 * @api
13 */
14interface ViewInterface
15{
16
17    /**
18     * Add a variable to the view data collection.
19     * Can be chained, so $this->view->assign(..., ...)->assign(..., ...); is possible
20     *
21     * @param string $key Key of variable
22     * @param mixed $value Value of object
23     * @return ViewInterface an instance of $this, to enable chaining
24     * @api
25     */
26    public function assign($key, $value);
27
28    /**
29     * Add multiple variables to the view data collection
30     *
31     * @param array $values array in the format array(key1 => value1, key2 => value2)
32     * @return ViewInterface an instance of $this, to enable chaining
33     * @api
34     */
35    public function assignMultiple(array $values);
36
37    /**
38     * Renders the view
39     *
40     * @return string The rendered view
41     * @api
42     */
43    public function render();
44
45    /**
46     * Renders a given section.
47     *
48     * @param string $sectionName Name of section to render
49     * @param array $variables The variables to use
50     * @param boolean $ignoreUnknown Ignore an unknown section and just return an empty string
51     * @return string rendered template for the section
52     * @throws InvalidSectionException
53     */
54    public function renderSection($sectionName, array $variables = [], $ignoreUnknown = false);
55
56    /**
57     * Renders a partial.
58     *
59     * @param string $partialName
60     * @param string $sectionName
61     * @param array $variables
62     * @param boolean $ignoreUnknown Ignore an unknown section and just return an empty string
63     * @return string
64     */
65    public function renderPartial($partialName, $sectionName, array $variables, $ignoreUnknown = false);
66}
67