/** * {@inheritdoc} */ public function getRawValue(ResultRecordInterface $record) { $label = null; try { $label = $record->getValue($this->getOr(self::DATA_NAME_KEY, $this->get(self::NAME_KEY))); } catch (\LogicException $e) { } return $this->twig->loadTemplate(self::TEMPLATE)->render(['url' => parent::getRawValue($record), 'label' => $label]); }
public function testRemoveExtension() { $twig = new Environment(new \Twig_Loader_String()); $twig->addExtension(new EnvironmentExtension()); $twig->removeExtension('environment_test'); $this->assertFalse(array_key_exists('test', $twig->getTags())); $this->assertFalse(array_key_exists('foo_filter', $twig->getFilters())); $this->assertFalse(array_key_exists('foo_function', $twig->getFunctions())); $this->assertFalse(array_key_exists('foo_test', $twig->getTests())); $this->assertFalse(array_key_exists('foo_unary', $twig->getUnaryOperators())); $this->assertFalse(array_key_exists('foo_binary', $twig->getBinaryOperators())); $this->assertFalse(array_key_exists('foo_global', $twig->getGlobals())); $this->assertCount(2, $twig->getNodeVisitors()); }