/*
(non-PHPdoc)
@see \Ajax\bootstrap\html\BaseHtml::compile()
429301
public function compile(JsUtils $js=NULL, &$view=NULL) {
		if ($this->autoActive) {
			$this->setActive();
		}
		$count=$this->count();
		for($i=1; $i < $count; $i++) {
			$this->content[$i]->wrap($this->getContentDivider($i - 1));
		}
		return parent::compile($js, $view);
	}
184752
public function compile()
    {
        if (null !== $this->parameterBag) {
            $blocks = $this->getCoreBlocks();
            $blocks = array_merge($blocks, $this->getThirdPartyBlocks());
            foreach ($blocks as $block) {
                $this->prepareBlock($block);
            }
        }

        Config::read($this);

        parent::compile();
    }
1361430
public function compile(JsUtils $js=NULL, &$view=NULL) {
		$this->slides [0]->setClass("item active");
		$this->indicators [0]->setClass("active");
		$this->createControls();
		return parent::compile($js, $view);
	}
968852
function compile(template) {
    el = $compile(template)(pageScope);
    root = $rootElement.append(el)[0];
    body = $document[0].body;
    body.appendChild(root);

    pageScope.$apply();

    return el;
  }
823214
public function compile()
	{
		if ($this->multiPage)
		{
			$objPages = \PageModel::findMultipleByIds(\StringUtil::deserialize($this->data->multiPage));

			// Return if there are no pages
			if ($objPages === null)
			{
				return;
			}

			$arrPages = array();

			// Sort the array keys according to the given order
			if ($this->data->orderPage != '')
			{
				$tmp = \StringUtil::deserialize($this->data->orderPage);

				if (!empty($tmp) && is_array($tmp))
				{
					$arrPages = array_map(function () {}, array_flip($tmp));
				}
			}

			// Add the items to the pre-sorted array
			while ($objPages->next())
			{
				$arrPages[$objPages->id] = $objPages->row();
			}

			$arrPages = array_values(array_filter($arrPages));
			
			$this->writeToTemplate($arrPages);
		}
		else
		{
			if (($objPage = \PageModel::findById($this->data->singlePage)) !== null)
			{
                $this->writeToTemplate($objPage->row());
            }
		}
	}
745674
public function compile(JsUtils $js=NULL, &$view=NULL) {
		if (isset($this->_popup)){
			$this->_popup->compile($js);
		}
		return parent::compile($js, $view);
	}
1174255
private function compile()
    {
        // replace pseudo {param}:type syntax to valid regex
        if (strpos($this->regex, '}:') !== false) {
            $this->regex = preg_replace('#\{([a-zA-Z0-9_-]+)\}:([a-z]+)#', '(?P<$1>:$2)', $this->expression);
            $this->regex = str_replace(
                array_keys($this->regexExpression),
                array_values($this->regexExpression),
                $this->regex
            );
        }

        // replace pseudo {param} syntax without type to valid regex
        if (strpos($this->regex, '}') !== false) {
            $this->regex = preg_replace('#\{([a-zA-Z_]+)\}#', '(?P<$1>[^\/]+)', $this->regex);
        }

        // allow optional trailing slash at the end
        if (substr($this->regex, -1) !== '/') {
            $this->regex .= '[\/]?';
        }
    }
674730
public function _compile(&$view=NULL, $view_var='script_foot', $script_tags=TRUE) {
		// Components UI
		$ui=$this->ui();
		if ($this->ui()!=NULL) {
			if ($ui->isAutoCompile()) {
				$ui->compile(true);
			}
		}

		// Components BS
		$bootstrap=$this->bootstrap();
		if ($this->bootstrap()!=NULL) {
			if ($bootstrap->isAutoCompile()) {
				$bootstrap->compile(true);
			}
		}

		// Components Semantic
		$semantic=$this->semantic();
		if ($semantic!=NULL) {
			if ($semantic->isAutoCompile()) {
				$semantic->compile(true);
			}
		}

		// External references
		$external_scripts=implode('', $this->jquery_code_for_load);
		extract(array (
				'library_src' => $external_scripts
		));

		if (count($this->jquery_code_for_compile)==0) {
			// no inline references, let's just return
			return;
		}

		// Inline references
		$script='$(document).ready(function() {'."\n";
		$script.=implode('', $this->jquery_code_for_compile);
		$script.='});';

		$this->jquery_code_for_compile=array();
		if($this->params["debug"]==false){
			$script=$this->minify($script);
		}
		$output=($script_tags===FALSE) ? $script : $this->inline($script);

		if ($view!==NULL){
			$this->jsUtils->createScriptVariable($view,$view_var, $output);
		}
		return $output;
	}
832913
protected function compile()
    {
        $this->Template->start = $this->getRelatedStart($this);
        $this->Template->stop = $this->getRelatedStop($this);
        $this->Template->separators = $this->getRelatedSeparators($this);
        $this->Template->identifier = sprintf(static::$IDENTIFIER, $this->getRelatedStart($this)->id);


        $this->Template->countItems = $this->countItems($this);
        $this->Template->carouselId = $this->getCarouselId($this);
        $this->Template->carouselAutoplay = $this->carouselAutoplay ? 'carousel' : 'false';
        $this->Template->carouselReactToKeyboard = $this->carouselReactToKeyboard ? 'true' : 'false';
        $this->Template->carouselPauseOnHover = $this->carouselPauseOnHover ? 'hover' : 'false';
        $this->Template->carouselInfiniteCycle = $this->carouselInfiniteCycle ? 'true' : 'false';
    }
61223
public function compile()
	{
		//reset arrays
		$this->params     = [];
		$this->paramNames = [];
		$this->conditions = [];

		$this->compiled = true;

		$uri = $this->normalizeUri($this->getUri());

		// match patterns like /{param?:regex}
		// tested in https://regex101.com/r/gP6yH7
		$regex = preg_replace_callback(
			'#(?:(\\/)?\\{(\\w+)(\\?)?(?::((?:\\\\\\{|\\\\\\}|[^{}]|\\{\\d(?:\\,(?:\\d)?)?\\})+))?\\})#',
			[$this, 'createRegex'],
			$uri
		);

		$regex .= "/?";

		$regex = '#^' . $regex . '$#';

		if ($this->caseSensitive === false)
		{
			$regex .= 'i';
		}

		$this->pattern = $regex;

		return $this;
	}
664797
protected function compile()
    {
        $config  = StringUtil::deserialize($this->bs_navbarModules, true);
        $modules = [];
        $models  = $this->prefetchModules($config);

        foreach ($config as $module) {
            $id = $module['module'];

            if ($id != '' && !$module['inactive'] && array_key_exists($id, $models)) {
                $modules[] = $this->generateModule($module, $models[$id]);
            }
        }

        $cssID = $this->cssID;

        if ($this->cssID[1] == '') {
            $cssID[1] = 'navbar-light bg-light';
        }

        if ($this->bs_isResponsive && $this->bs_toggleableSize) {
            $cssID[1] = trim($cssID[1] . ' navbar-expand-' . $this->bs_toggleableSize);
        }

        $this->cssID             = $cssID;
        $this->Template->modules = $modules;
    }
755332
public function compile()
    {
        //Unificamos ficheros para que no se retarde mucho el proceso
        $this->files = array_unique($this->files);
        switch ($this->type) {
            default:
            case "js":
                $this->compileJs();
                break;
            case "css":
                $this->compileCss();
                break;
        }

        return $this;
    }
292385
protected function compile()
    {
        $this->Template->start = $this->getRelatedStart($this);
        $this->Template->stop = $this->getRelatedStop($this);
        $this->Template->separators = $this->getRelatedSeparators($this);
        if ($this->getRelatedStart($this) !== null)
        {
            $this->Template->identifier = sprintf(self::$IDENTIFIER, $this->getRelatedStart($this)->id);
        }

        // Labels
        $this->Template->carouselPrevious = $GLOBALS['TL_LANG']['MSC']['carouselPrev'];
        $this->Template->carouselNext = $GLOBALS['TL_LANG']['MSC']['carouselNext'];

    }
927145
public function compile()
    {
        extract($this->vars);

        ob_start();
        /** @noinspection PhpIncludeInspection */
        include $this->filename;
        $__strCompiled__ = ob_get_contents();
        ob_end_clean();

        return $__strCompiled__;
    }
1077845
private function _compile() {
		
		// remove spaces
		$this->_result = str_replace('{{ ', '{{', $this->_content);
		$this->_result = str_replace(' }}', '}}', $this->_result);
		
		// check if
		if ($this->ifs) {
			foreach ($this->ifs as $key => $val) {
				$this->_setBool($key, $val);
			}
			empty($this->ifs);
		}
		
		// check loop
		if ($this->loops) {
			foreach ($this->loops as $key => $val) {
				$this->_setArray($key, $val);
			}
			empty($this->loops);
		}
		
		// check static replaces
		if ($this->vars) {
			foreach ($this->vars as $key => $val) {
				$this->_setString($key, $val);
			}
			empty($this->vars);
		}
		
		// include global vars
		if (is_array($this->injects)) {
			foreach ($this->injects as $inject) {
				global $ {
					$inject
				};
			}
			extract($this->injects);
		}
		
		// remove if and loop traces
		$this->_result = preg_replace("/<if\..*?>(.*?)<\/if\..*?>/s", '', $this->_result);
		$this->_result = preg_replace("/<loop\..*?>(.*?)<\/loop\..*?>/s", '', $this->_result);
		
		// check dynamic variables
		$pattern = "\{\{(.*?)\}\}";
		preg_match_all("/" . $pattern . "/", $this->_result, $matches, PREG_SET_ORDER);
		foreach ($matches as $block) {
			$chunk = $block[0];
			$codes = '<?php ' . $this->config['echo'] . '(' . trim($block[1]) . ')' . '; ?>';
			$this->_result = str_replace($chunk, $codes, $this->_result);
		}
		
		// attempt to create cache file for this template in storage directory
		$cache_file = md5($this->_filename) . '.compiled';
		$cache = $this->config['dir_cache'] . '/' . $cache_file;
		$fd = @fopen($cache, 'w+');
		@fwrite($fd, $this->_result);
		@fclose($fd);
		
		// when failed, try to create in /tmp
		if (!file_exists($cache)) {
			$cache = '/tmp/' . $cache_file;
			$fd = @fopen($cache, 'w+');
			@fwrite($fd, $this->_result);
			@fclose($fd);
		}
		
		// if template cache file created then include it, else use eval() to compile
		if (file_exists($cache)) {
			ob_start();
			include $cache;
			$this->_compiled = ob_get_contents();
			ob_end_clean();
			@unlink($cache);
		} else {
			ob_start();
			eval('?>' . $this->_result . '<?php ');
			$this->_compiled = ob_get_contents();
			ob_end_clean();
		}
	}
548917
protected function compile()
	{
		if($this->objWrapper->getType() == ContentWrapper\Model::TYPE_START)
		{
			$GLOBALS['accordionGroup'] = 'accordion-group-' . $this->id;
			$GLOBALS['accordionGroupFirst'] = true;
			$this->Template->groupId = $GLOBALS['accordionGroup'];
		}
		else
		{
			$GLOBALS['accordionGroup'] = null;
			$GLOBALS['accordionGroupFirst'] = null;
		}
	}
300003
public function compile(JsUtils $js=NULL, &$view=NULL) {
		$this->setProperty("class", "nav nav-".$this->_tabsType." ".$this->stacked);
		return parent::compile($js, $view);
	}