TemplateReferenceInterface
interface TemplateReferenceInterface
Interface to be implemented by all templates.
Methods
| array | all() Gets the template parameters. | |
| $this | set(string $name, string $value) Sets a template parameter. | |
| string | get(string $name) Gets a template parameter. | |
| string | getPath() Returns the path to the template. | |
| string | getLogicalName() Returns the "logical" template name. | |
| string | __toString() Returns the string representation as shortcut for getLogicalName(). |
Details
array all()
Gets the template parameters.
Return Value
| array | An array of parameters |
$this set(string $name, string $value)
Sets a template parameter.
Parameters
| string | $name | The parameter name |
| string | $value | The parameter value |
Return Value
| $this |
Exceptions
| InvalidArgumentException | if the parameter name is not supported |
string get(string $name)
Gets a template parameter.
Parameters
| string | $name | The parameter name |
Return Value
| string | The parameter value |
Exceptions
| InvalidArgumentException | if the parameter name is not supported |
string getPath()
Returns the path to the template.
By default, it just returns the template name.
Return Value
| string | A path to the template or a resource |
string getLogicalName()
Returns the "logical" template name.
The template name acts as a unique identifier for the template.
Return Value
| string | The template name |
string __toString()
Returns the string representation as shortcut for getLogicalName().
Alias of getLogicalName().
Return Value
| string | The template name |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Templating/TemplateReferenceInterface.html