Symfony\Component\Templating\TemplateReference::set PHP Method

set() public method

Sets a template parameter.
public set ( string $name, string $value ) : Symfony\Component\Templating\TemplateReferenceInterface
$name string The parameter name
$value string The parameter value
return Symfony\Component\Templating\TemplateReferenceInterface The TemplateReferenceInterface instance
    public function set($name, $value)
    {
        if (array_key_exists($name, $this->parameters)) {
            $this->parameters[$name] = $value;
        } else {
            throw new \InvalidArgumentException(sprintf('The template does not support the "%s" parameter.', $name));
        }

        return $this;
    }