Compiles the template using the context.
480016
public function compile()
    {
        if ($this->stopwatch) {
            $this->stopwatch->start('bolt.render', 'template');
        }
        $output = $this->template->render($this->context);
        $this->setContent($output);
        $this->compiled = true;
        if ($this->stopwatch) {
            $this->stopwatch->stop('bolt.render');
        }
    }
122882
public function compile(): void
	{
		// Get teplate contents

		$contents = $this->fileSystem->get($this->template);

		// Compile template

		foreach($this->compileOrder as $method)
		{
			$contents = $this->$method($contents);
		}

		// Store compiled template

		$this->fileSystem->put($this->cachePath . '/' . md5($this->template) . '.php', trim($contents));
	}
782430
def prepare_context(env)
      context = Roger::Template::TemplateContext.new(self, env)

      # Extend context with all helpers
      self.class.helpers.each do |mod|
        context.extend(mod)
      end

      context
    end
670361
protected void code(String template, String packageName, String className, Supplier<Map<String, Object>> context) {
        StringBuffer code = generate(template, context);
        writeCode(packageName, className, code);
    }
496611
public Context setTemplate(Template template) {
        checkThread();
        if (template != null) {
            setEngine(template.getEngine());
        }
        this.template = template;
        return this;
    }
175759
public static function compileStatic(&$context, $name) {
        // Check for recursive partial
        if (!$context['flags']['runpart']) {
            $context['partialStack'][] = $name;
            $diff = count($context['partialStack']) - count(array_unique($context['partialStack']));
            if ($diff) {
                $context['error'][] = 'I found recursive partial includes as the path: ' . implode(' -> ', $context['partialStack']) . '! You should fix your template or compile with LightnCandy::FLAG_RUNTIMEPARTIAL flag.';
            }
        }

        $code = Compiler::compileTemplate($context, preg_replace('/^/m', $context['tokens']['partialind'], $context['usedPartial'][$name]));

        if (!$context['flags']['runpart']) {
            array_pop($context['partialStack']);
        }

        return $code;
    }
794532
public function compile() {
		foreach ($this->_params as $key => $value) {
			if (!strpos($key, ':')) {
				continue;
			}
			unset($this->_params[$key]);
			$this->_meta[$key] = $value;
		}

		$this->_match = $this->_params;

		if ($this->_template === '/' || $this->_template === '') {
			$this->_pattern = '@^/*$@';
			return;
		}
		$this->_pattern = "@^{$this->_template}\$@";
		$match = '@([/.])?\{:([^:}]+):?((?:[^{]+?(?:\{[0-9,]+\})?)*?)\}@S';

		if ($this->_config['unicode']) {
			$this->_pattern .= 'u';
		}
		preg_match_all($match, $this->_pattern, $m);

		if (!$tokens = $m[0]) {
			return;
		}
		$slashes = $m[1];
		$params = $m[2];
		$regexs = $m[3];
		unset($m);
		$this->_keys = [];

		foreach ($params as $i => $param) {
			$this->_keys[$param] = $param;
			$this->_pattern = $this->_regex($regexs[$i], $param, $tokens[$i], $slashes[$i]);
		}
		$this->_defaults += array_intersect_key($this->_params, $this->_keys);
		$this->_match = array_diff_key($this->_params, $this->_defaults);
	}
1334138
function compileTemplate( $tpl, $keyData, $uri, $res, $templatePath, &$extraParameters, &$resourceData )
    {
        $key = $this->cacheKey( $keyData, $res, $templatePath, $extraParameters );
        return eZTemplateCompiler::compileTemplate( $tpl, $key, $resourceData );
    }
482440
function(template) {
    if (template && !template.compiled) {
      // Set compiling flag on fragments, but don't turn it false until the outermost template is done
      var lastCompilingValue = this.compiling;
      this.compiling = true;
      // Set this before compiling so we don't get into infinite loops if there is template recursion
      template.compiled = true;
      template.bindings = compile(this, template);
      this.compiling = lastCompilingValue;
    }
    return template;
  }
483548
public function compile() {
		$this->start('Compiling to '. $this->host);

		// fix path
		$this->localProj	= self::path($this->localProj);
		$this->remoteProj	= rtrim($this->remoteProj, DIRECTORY_SEPARATOR);
		
		// Work from project
		if(isset($this->localProj) && is_dir($this->localProj))
			chdir($this->localProj);
		
		// documentation
		if(isset($this->localDoc))
			$this->start('Creating Documentation from ' . $this->localDoc)->makeDoc()->finish();
		
		// twig templates
		if(isset($this->localTpl))
			$this->start('Creating JS Templates from ' . $this->localTpl)->makeTpl()->finish();
		
		
		// static files
		$localStatic = self::path(sys_get_temp_dir()) . 'data' . time() . DIRECTORY_SEPARATOR;
		$this->wipe[] = $localStatic;
		
		foreach($this->remoteStatic as $type => $trash) {
			if(method_exists($this, $type)) {
				$this->tmp[ $type ] = $localStatic . $type . DIRECTORY_SEPARATOR;
				self::readyDir( $this->tmp[ $type ] );

				// process static files
				$this->start('Processing '. $type)->$type()->finish();
				
			} elseif(!empty($this->localStatic[ $type ])) {
					// just moved the folder
					$this->tmp[ $type ] = self::path(current ($this->localStatic[ $type ]));
					
					// remove if not there
					if(!file_exists($this->tmp[ $type ])) 
						unset ($this->remoteStatic[ $type ]);
			}
		}

		// run through static files then upload them
		$this->start('Uploading Static')->uploadStatic()->finish();

		// upload project
		$cmd = [
			'pscp',
			'-p',									// preserve attributes
			'-r',									// copy recursively
			'-q',									// silent
			//'-sftp',								// for use of SFTP protocal
			'-batch',								// non interactive
			'-C',									// enable compression
			'-i', static::safeDir($this->ppk),						// Private key file to access server
		];
		
		// Directory to upload
		foreach($this->localCopy as $name)
			$cmd[] = static::safeDir($this->localProj . $name);
		
		// host:path on server to save data
		$cmd[] = $this->host .':'. $this->remoteProj;
		
		$this->start('Uploading Project')->runLocal($cmd)->finish();

		// config
		if(!isset($this->s3) && !empty($this->remoteStatic)) {
			// reset file permissions
			$cmd = array();
			foreach($this->remoteStatic as $type => $path) {
				$cmd[] = 'chmod 774 -R '. $path;
				// $cmd[] = 'chown mo:www-data -R '. $path;
			}
			
			$this->start('Updating Server Enviroment')->runRemote( $cmd )->finish();
		}

		// clean up
		$this	->start('Cleaning up');
			foreach($this->wipe as $dir)
				self::wipeDir($dir, true);
		$this	->finish();
		
		// finally
		$this->finish();
	}
596057
def compile(template) #:nodoc:
      template.gsub(/:[a-z0-9_]+/) do |match|
        position = TEMPLATE_ARGUMENT_ORDER.index(match)
        if position
          "%#{position + 1}$s"
        else
          match
        end
      end
    end
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();
    }
124496
function fixTemplateContext(template, fix) {
    var _template_r = template.r;
    template.r = function(contextStack) {
        var context = contextStack[contextStack.length-1];
        contextStack[contextStack.length-1] = fix(context);
        return _template_r.apply(this,arguments);
    };
}
473178
function compile(fragments, template) {
  var walker = document.createTreeWalker(template, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
  var bindings = [], currentNode, parentNode, previousNode;

  // Reset first node to ensure it isn't a fragment
  walker.nextNode();
  walker.previousNode();

  // find bindings for each node
  do {
    currentNode = walker.currentNode;
    parentNode = currentNode.parentNode;
    bindings.push.apply(bindings, getBindingsForNode(fragments, currentNode, template));

    if (currentNode.parentNode !== parentNode) {
      // currentNode was removed and made a template
      walker.currentNode = previousNode || walker.root;
    } else {
      previousNode = currentNode;
    }
  } while (walker.nextNode());

  return bindings;
}
410551
protected function compile()
  {

    global $objPage;


		if (FE_USER_LOGGED_IN)
    {
      $this->import('FrontendUser', 'User');
    }

    switch ($this->strType)
    {
      case "track":
        $objData = $this->Database->prepare("SELECT * FROM tl_c4g_tracking_tracks WHERE id=? AND member=?")
                               ->execute($this->intTrackId, $this->User->id);
        break;
      case "poi":
        $objData = $this->Database->prepare("SELECT * FROM tl_c4g_tracking_pois WHERE id=? AND member=?")
                               ->execute($this->intPoiId, $this->User->id);
        break;
    }

		if ($objData->numRows == 0)
		{
			// Do not index or cache the page
			$objPage->noSearch = 1;
			$objPage->cache = 0;

			// Send a 404 header
			header('HTTP/1.1 404 Not Found');
			$this->Template->error = '<p class="error">' . sprintf($GLOBALS['TL_LANG']['MSC']['invalidPage'], \Input::get('items')) . '</p>';
			return;
		}


		if (!$this->editWithoutFilter && (FE_USER_LOGGED_IN && $this->User->id!=$objData->member))
		{
			// Do not index or cache the page
			$objPage->noSearch = 1;
			$objPage->cache = 0;

			// Send a 404 header
			header('HTTP/1.1 404 Not Found');
			$this->Template->error = '<p class="error">' . sprintf($GLOBALS['TL_LANG']['MSC']['invalidPage'], \Input::get('items')) . '</p>';
			return;
		}

		$arrFields = $this->getFields($objData);
		$arrFieldsForTemplate = array();

		foreach ($arrFields as $arrField)
    {

      $strClass = $GLOBALS['TL_FFL'][$arrField['inputType']];
      if (!$this->classFileExists($strClass))
      {
          continue;
      }

      $arrField['mandatory'] = $arrField['eval']['mandatory'];
      $arrField['tableless'] = true;

      $objWidget = new $strClass($arrField);

      if ($arrField['eval']['rgxp'])
      {
        $objWidget->rgxp = $arrField['eval']['rgxp'];
      }

      if ($arrField['eval']['maxlength'])
      {
        $objWidget->maxlength = $arrField['eval']['maxlength'];
      }

      if (!$arrField['id'] && $arrField['name'])
      {
        $objWidget->id = $arrField['name'];
      }

      if ($arrField['eval']['toggleFields'])
      {
        $objWidget->class = $objWidget->class ? ($objWidget->class . " toggle") : "toggle";
      }

      if ($arrField['eval']['toggleBy'])
      {
        $strToggleByClass = "toggleBy" . ucfirst($arrField['eval']['toggleBy']);

        $blnIsVisible = false;

        $arrToggleField = $this->arrFields[$arrField['eval']['toggleBy']];

        if ($arrToggleField['inputType'] == "checkbox")
        {
          if (\Input::post($arrToggleField['name']))
          {
            $blnIsVisible = true;

            if (!$arrField['eval']['mandatory'] && $arrField['eval']['toggleMandatory'])
            {
              $objWidget->mandatory = true;
            }
          }
        }

        if (!$blnIsVisible)
        {
          $strToggleByClass .= " toggleInvisible";
        }
        else
        {
          $strToggleByClass .= " toggleVisible";
        }

        $objWidget->class = $objWidget->class ? ($objWidget->class . " " . $strToggleByClass) : $strToggleByClass;
      }

      if ($this->Input->post('FORM_SUBMIT') == 'formTrackEdit')
      {
          $objWidget->validate();
          if ($objWidget->hasErrors())
          {
            $this->doNotSubmit = true;
          }
      }

      if ($arrField['eval']['toggleMandatory'] && !$objWidget->mandatory)
      {
        $objWidget->label = '<span class="invisible">Pflichtfeld</span>' . $arrField['label'] . '<span class="mandatory">*</span>';
      }

      $this->Template->fields .= $objWidget->parse();
      $arrFieldsForTemplate[$arrField['name']] = $objWidget->parse();
    }

    if ($this->Input->post('FORM_SUBMIT') == 'formTrackEdit' && !$this->doNotSubmit)
    {
      // Check whether there is a jumpTo page

      $arrForDatabaseUpdate = array();
      $arrForDatabaseUpdate['name'] = \Input::post('name');
      $arrForDatabaseUpdate['visibility'] = \Input::post('visibility');
      $arrForDatabaseUpdate['comment'] = \Input::post('comment');
      if ($arrForDatabaseUpdate['visibility'] == "membergroups")
      {
        $arrForDatabaseUpdate['groups'] = serialize(\Input::post('visibilityGroups'));
      }
      else
      {
        $arrForDatabaseUpdate['groups'] = null;
      }

      if (\Input::post('deleteEntry') == 'delete')
      {
        $arrForDatabaseUpdate['forDelete'] = true;
      }
      else
      {
        $arrForDatabaseUpdate['forDelete'] = false;
      }

      switch ($this->strType)
      {
        case "track":
          $this->Database->prepare("UPDATE tl_c4g_tracking_tracks %s WHERE id=?")
                     ->set($arrForDatabaseUpdate)
                     ->execute($this->intTrackId);
          break;
        case "poi":
          $this->Database->prepare("UPDATE tl_c4g_tracking_pois %s WHERE id=?")
                     ->set($arrForDatabaseUpdate)
                     ->execute($this->intPoiId);
          break;
      }



    	if (($objJumpTo = $this->objModel->getRelated('jumpTo')) !== null)
    	{
    		$this->jumpToOrReload($objJumpTo->row());
    	}

    	$this->reload();
    }

    $this->Template->fieldData = $arrFieldsForTemplate;
    $this->Template->action = "";
    $this->Template->formId = "formTrackEdit";
    $this->Template->method = "post";
    $this->Template->enctype = "";
    $this->Template->attributes = "";
    //$this->Template->novalidate = "novalidate";
    $this->Template->formSubmit = "formTrackEdit";

    $this->Template->submitTitle = "Speichern";


  }
1261243
public function preCompile(CompilationContext $compilationContext)
    {
        $this->compiler = $compilationContext->compiler;

        /*
         * Pre-Compile methods
         */
        foreach ($this->methods as $method) {
            if ('class' == $this->getType() && !$method->isAbstract()) {
                $method->preCompile($compilationContext);
            }
        }
    }
402313
protected function compile(): void
    {
        $metaModel = $this->factory->translateIdToMetaModelName($this->metamodel);

        try {
            $this->Template->editor = $this->editor->editFor($metaModel, 'create');
        } catch (NotEditableException $exception) {
            throw new AccessDeniedException($exception->getMessage());
        } catch (NotCreatableException $exception) {
            throw new AccessDeniedException($exception->getMessage());
        }
    }