|
0
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
/* |
|
|
4 |
* This file is part of the Symfony package. |
|
|
5 |
* |
|
|
6 |
* (c) Fabien Potencier <fabien@symfony.com> |
|
|
7 |
* |
|
|
8 |
* For the full copyright and license information, please view the LICENSE |
|
|
9 |
* file that was distributed with this source code. |
|
|
10 |
*/ |
|
|
11 |
|
|
|
12 |
namespace Symfony\Component\Templating; |
|
|
13 |
|
|
|
14 |
/** |
|
|
15 |
* Interface to be implemented by all templates. |
|
|
16 |
* |
|
|
17 |
* @author Victor Berchet <victor@suumit.com> |
|
|
18 |
* |
|
|
19 |
* @api |
|
|
20 |
*/ |
|
|
21 |
interface TemplateReferenceInterface |
|
|
22 |
{ |
|
|
23 |
/** |
|
|
24 |
* Gets the template parameters. |
|
|
25 |
* |
|
|
26 |
* @return array An array of parameters |
|
|
27 |
* |
|
|
28 |
* @api |
|
|
29 |
*/ |
|
|
30 |
function all(); |
|
|
31 |
|
|
|
32 |
/** |
|
|
33 |
* Sets a template parameter. |
|
|
34 |
* |
|
|
35 |
* @param string $name The parameter name |
|
|
36 |
* @param string $value The parameter value |
|
|
37 |
* |
|
|
38 |
* @return TemplateReferenceInterface The TemplateReferenceInterface instance |
|
|
39 |
* |
|
|
40 |
* @throws \InvalidArgumentException if the parameter is not defined |
|
|
41 |
* |
|
|
42 |
* @api |
|
|
43 |
*/ |
|
|
44 |
function set($name, $value); |
|
|
45 |
|
|
|
46 |
/** |
|
|
47 |
* Gets a template parameter. |
|
|
48 |
* |
|
|
49 |
* @param string $name The parameter name |
|
|
50 |
* |
|
|
51 |
* @return string The parameter value |
|
|
52 |
* |
|
|
53 |
* @throws \InvalidArgumentException if the parameter is not defined |
|
|
54 |
* |
|
|
55 |
* @api |
|
|
56 |
*/ |
|
|
57 |
function get($name); |
|
|
58 |
|
|
|
59 |
/** |
|
|
60 |
* Returns the path to the template. |
|
|
61 |
* |
|
|
62 |
* By default, it just returns the template name. |
|
|
63 |
* |
|
|
64 |
* @return string A path to the template or a resource |
|
|
65 |
* |
|
|
66 |
* @api |
|
|
67 |
*/ |
|
|
68 |
function getPath(); |
|
|
69 |
|
|
|
70 |
/** |
|
|
71 |
* Returns the "logical" template name. |
|
|
72 |
* |
|
|
73 |
* The template name acts as a unique identifier for the template. |
|
|
74 |
* |
|
|
75 |
* @return string The template name |
|
|
76 |
* |
|
|
77 |
* @api |
|
|
78 |
*/ |
|
|
79 |
function getLogicalName(); |
|
|
80 |
} |