$value), array('name' => $name, 'operator' => $operator), $lineno, $tag); } public function getHelperMethod() { $operator = $this->getAttribute('operator')->getValue(); switch ($operator) { case '+': return 'addCssStyle'; case '-': return 'removeCssStyle'; default: throw new \Twig_Error("Operator {$operator} no found;"); } } }