Checks if the text has <ktml:wrapper template="string with %s placeholder for template contents">

If it does, wraps the whole output using the passed template

@param $text
@param TemplateInterface $template A template object.
@return void
495999
public function filter(&$text, TemplateInterface $template)
    {
        if (strpos($text, '<ktml:wrapper') !== false)
        {
            if(preg_match_all('#<ktml:wrapper\s+template="([^"]+)"\s*>#siU', $text, $matches, PREG_SET_ORDER))
            {
                foreach ($matches as $match)
                {
                    $wrapper_template = html_entity_decode($match[1]);

                    if ($wrapper_template) {
                        $text = sprintf($wrapper_template, $text);
                        $text = str_replace($matches[0], '', $text);

                        return;
                    }
                }
            }
        }
    }
241229
public function setTemplate($template)
	{
		if (!($template instanceof Template))
		{
			$template = new Template($template);
		}

		$this->template = $template;
	}
1270040
public function onParseTemplate(Template $template): void
    {
        if (strpos($template->getName(), 'fe_') !== 0) {
            return;
        }

        $template->bootstrapEnvironment = $this->environment;
    }
1341561
public function onParseTemplate(Template $template): void
    {
        if (substr($template->getName(), 0, 4) !== 'nav_') {
            return;
        }

        $template->navClass = (string) $this->navClass;
    }
540058
public function dontSeeInPageSource($text)
    {
        $this->assertThatItsNot(
            $this->webDriver->getPageSource(),
            new PageConstraint($text, $this->_getCurrentUri()),
            ''
        );
    }
571244
public function addPlaceholder($text, $isPlain = true, $lang = 'en')
    {
        $value = '__placeholder';

        $this->placeholders[$lang] = new Label($text, $this->getLocaleKey('_placeholder'), $isPlain, $lang, $this->name . $value);
    }
1067513
public function msgText($text)
    {
        $this->isHTML(false);
        $text = self::html2text($text, true);
        $text = self::normalizeBreaks($text);
        $this->Body = $text;
    }
350698
private function _checkVariableNaming($text) {
		if ($this->_inClass || $this->_inInterface) {
			if ($this->_inFunctionStatement || $this->_inInterfaceStatement) {
				$this->_checkScopedVariableNaming($text, 'functionParameterNaming', 'FUNCTION_PARAMETER_NAMING');
			} else if ($this->_inFunction) {
				if (array_key_exists($text, $this->_functionParameters)) {
					$this->_checkScopedVariableNaming($text, 'functionParameterNaming', 'FUNCTION_PARAMETER_NAMING');
				} else {
					$this->_checkScopedVariableNaming($text, 'localVariableNaming', 'LOCAL_VARIABLE_NAMING');
				}
			} else {
				$this->_checkScopedVariableNaming($text, 'memberVariableNaming', 'MEMBER_VARIABLE_NAMING');
			}
		} else {
			$this->_checkScopedVariableNaming($text, 'topLevelVariableNaming', 'TOPLEVEL_VARIABLE_NAMING');
		}
	}
280006
public function dontSeeInShellOutput($text)
    {
        $this->debug($this->output);
        \PHPUnit\Framework\Assert::assertNotContains($text, $this->output);
    }
932635
public function check(DOMElement $template, Tag $tag)
	{
		// Regexp that matches the function call
		$regexp = '#(?!<\\pL)' . preg_quote($this->funcName, '#') . '\\s*\\(#iu';

		// Allow whitespace around colons (NOTE: colons are unnecessarily escaped by preg_quote())
		$regexp = str_replace('\\:', '\\s*:\\s*', $regexp);

		foreach ($this->getExpressions($template) as $expr => $node)
		{
			// Remove string literals from the expression
			$expr = preg_replace('#([\'"]).*?\\1#s', '', $expr);

			// Test whether the expression contains a document() call
			if (preg_match($regexp, $expr))
			{
				throw new UnsafeTemplateException('An XPath expression uses the ' . $this->funcName . '() function', $node);
			}
		}
	}
804155
protected function _parseTags(&$text, TemplateInterface $template)
    {
        $tags = '';

        $matches = array();
        if(preg_match_all('#<meta\ content="([^"]+)"(.*)\/>#siU', $text, $matches))
        {
            foreach($matches[1] as $key => $match)
            {
                //Set required attributes
                $attribs = array(
                    'content' => $match
                );

                $attribs = array_merge($this->parseAttributes( $matches[2][$key]), $attribs);
                $tags .= $this->_renderTag($attribs, null, $template);
            }

            $text = str_replace($matches[0], '', $text);
        }

        return $tags;
    }
958141
private function checkTemplate($template)
    {
        if ( ! is_string($template)) {
            $type = gettype($template);
            throw new Exceptions\InvalidTypeException(
                "The default template name must be a string, $type given."
            );
        }

        $template = strtolower(trim($template));

        if ( ! array_key_exists($template, $this->supported)) {
            throw new Exceptions\InvalidTemplateException(
                "The template [$template] is not supported."
            );
        }
    }
930030
public function filter(&$text, TemplateInterface $template)
    {
        $matches = array();

        if(preg_match_all('#<ktml:content(.*)>#siU', $text, $matches))
        {
            foreach($matches[0] as $key => $match)
            {
                $attributes = array_merge($this->_attributes,  $this->parseAttributes($matches[1][$key]));

                $content = $template->content();
                if(!empty($content))
                {
                    //If attributes are set but no decorator set it to <div>
                    $element = null;
                    if(!empty($attributes))
                    {
                        if(isset($attributes['decorator']))
                        {
                            $element = trim(strtolower($attributes['decorator']));
                            unset($attributes['decorator']);
                        }
                        else $element = 'div';
                    }

                    //Do not decorate if no element is defined
                    if($element)
                    {
                        $attribs = '';
                        if(!empty($attributes)) {
                            $attribs = ' '.$this->buildAttributes($attributes);
                        }

                        $content = sprintf('<'.$element.'%s>%s</'.$element.'>', $attribs, PHP_EOL.$content.PHP_EOL);
                    }
                }

                //Remove the tags
                $text = str_replace($match, $content , $text);
            }
        }
    }
805408
public function pageTextContains($text)
    {
        $actual = $this->session->getPage()->getText();
        $actual = preg_replace('/\s+/u', ' ', $actual);
        $regex = '/'.preg_quote($text, '/').'/ui';
        $message = sprintf('The text "%s" was not found anywhere in the text of the current page.', $text);

        $this->assertResponseText((bool) preg_match($regex, $actual), $message);
    }
893976
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('Available templates:');
        foreach ($this->factory->getAllNames() as $template_name) {
            $output->writeln('* '.$template_name);
        }
        $output->writeln('');
    }
937868
public function theResponseShouldContain($text)
    {
        $expectedRegexp = '/' . preg_quote($text) . '/i';
        $actual = (string) $this->response->getBody();
        Assertions::assertRegExp($expectedRegexp, $actual);
    }
426373
public function filter(&$text, TemplateInterface $template)
    {
        $matches = array();

        if(preg_match_all('#<ktml:toolbar([^>]*)>#siU', $text, $matches))
        {
            foreach($matches[0] as $key => $match)
            {
                $attributes = $this->parseAttributes($matches[1][$key]);

                //Create attributes array
                $config = new ObjectConfig($attributes);
                $config->append(array(
                    'type'  => 'actionbar',
                ));

                if($this->getIdentifier()->type != 'lib')
                {
                    if ($this->getIdentifier()->domain) {
                        $identifier = 'com://'.$this->getIdentifier()->domain.'/'.$this->getIdentifier()->package.'.template.helper.'.$config->type;
                    } else {
                        $identifier = 'com:'.$this->getIdentifier()->package.'.template.helper.'.$config->type;
                    }
                } else {
                    $identifier = 'lib:template.helper.'.$config->type;
                }

                $helper = $this->getObject('template.helper.factory')->createHelper($identifier);

                $html = '';
                if($toolbar = $this->getToolbar($helper->getToolbarType()))
                {
                    $config->toolbar = $toolbar; //set the toolbar in the config
                    
                    $html = $helper->render($config);
                }

                //Remove placeholder
                $text = str_replace($match, $html, $text);
            }
        }
    }