Gets a variable from the template

@param  string
779022
public function & get($key = null, $default = null)
	{
		if (is_null($default) and func_num_args() === 1)
		{
			return $this->_view->get($key);
		}
		return $this->_view->get($key, $default);
	}
882317
public function getVar($key)
    {
        return (array_key_exists($key, $this->vars)) ? $this->vars[$key] : null;
    }
835187
public function getVariable($key)
    {
        if (isset($this->variables[$key])) {
            return $this->variables[$key];
        }
        return false;
    }
960032
public function getVariable($variable) {
		
		if(true === isset($this -> variables[$variable])) {
			return $this -> variables[$variable];
		}
	}
378935
protected function variable(&$out)
    {
        $s = $this->count;

        if ($this->matchChar('$', false) && $this->keyword($name)) {
            $out = [Type::T_VARIABLE, $name];

            return true;
        }

        $this->seek($s);

        return false;
    }
229697
public function processString($string, array $vars = [])
    {
        // override the twig header vars for local resolution
        $this->grav->fireEvent('onTwigStringVariables');
        $vars += $this->twig_vars;

        $name = '@Var:' . $string;
        $this->setTemplate($name, $string);

        try {
            $output = $this->twig->render($name, $vars);
        } catch (\Twig_Error_Loader $e) {
            throw new \RuntimeException($e->getRawMessage(), 404, $e);
        }

        return $output;
    }
924671
public function fetchFromString($string ="", $data = [])
    {
        $data = array_merge($this->defaultVariables, $data);

        return $this->environment->createTemplate($string)->render($data);
    }
1130922
function getVariable( $var, $fallbackValue = null )
    {
        $ret = $fallbackValue;
        if ( isset( $_GET[$var] ) )
        {
            $ret = $_GET[$var];
        }
        else if ( $ret === null )
        {
            eZDebug::writeWarning( "Undefined get variable: $var",
                                   "eZHTTPTool" );
        }
        return $ret;
    }
1229388
public static function variable(string $string): string
	{
		$result = static::_cache(__FUNCTION__, $string);

		if ($result === false) {
			$camelized = static::camelize(static::underscore($string));
			$replace = \strtolower($camelized[0]);
			$result = $replace . \substr($camelized, 1);
			static::_cache(__FUNCTION__, $string, $result);
		}

		return $result;
	}
1165223
private function variable() {
    switch ($this->currentType) {
      case T_STRING:
      case T_NS_SEPARATOR:
      case T_NAMESPACE:
        $namespace_path = $this->name();
        if ($this->currentType === '(') {
          return $this->functionCall($namespace_path);
        }
        elseif ($this->currentType === T_DOUBLE_COLON) {
          return $this->varClass($namespace_path);
        }
        break;
      case T_STATIC:
        $class_name = $this->mustMatchToken(T_STATIC);
        return $this->varClass($class_name);
      case '$':
      case T_VARIABLE:
        $var = $this->indirectReference();
        if ($this->currentType === '(') {
          return $this->functionCall($var, TRUE);
        }
        elseif (!($var instanceof VariableVariableNode) && $this->currentType === T_DOUBLE_COLON) {
          return $this->varClass($var);
        }
        else {
          return $this->objectDereference($var);
        }
    }
    throw new ParserException(
      $this->filename,
      $this->iterator->getLineNumber(),
      $this->iterator->getColumnNumber(),
      "expected variable");
  }
1186721
protected static function fetchTemplate( $template, $parameters = array() )
    {
        $tpl = eZTemplate::factory();
        $existingPramas = array();

        foreach( $parameters as $name => $value )
        {
            if ( $tpl->hasVariable( $name ) )
                $existingPramas[$name] = $tpl->variable( $name );

            $tpl->setVariable( $name, $value );
        }

        $result = $tpl->fetch( $template );

        foreach( $parameters as $name => $value )
        {
            if ( isset( $existingPramas[$name] ) )
                $tpl->setVariable( $name, $existingPramas[$name] );
            else
                $tpl->unsetVariable( $name );
        }

        return $result;
    }
877474
public function get($name = ''){
            if(false === $var = apc_fetch($name)){
                apc_store($name, $var = parent::get($name));
            }

            return $var;
        }
818747
public function getVar($name = null)
    {
        $context = $this->_context;

        if ($name === null) {
            return $context->vars;
        } else {
            return isset($context->vars[$name]) ? $context->vars[$name] : null;
        }
    }
1078229
public function fetch($templateFile,$var) {
        $templateFile=substr($templateFile,strlen(THEME_PATH));
        $var['_think_template_path']=$templateFile;
        exit(json_encode($var));	
    }
271483
public static function getCode($number, $template = "")
    {
        $number = intval($number);
        $array = debug_backtrace();

        for ($i = 0; $i < $number; $i ++) {
            unset($array[$i]);
        }

        $code = "";
        foreach ($array as $row) {
            if (isset($row['file']) && isset($row['line'])) {
                if ($template == "") {
                    $code = " in file '" . $row['file'] . "' on line " . $row['line'];
                } else {
                    $code = strtr($template, [
                        "{file}" => $row['file'],
                        "{line}" => $row['line'],
                    ]);
                }
                break;
            }
        }

        return $code;
    }
1127161
public function getTemplate($name)
    {
        if (!isset($this->templates[$name])) {
            throw new MissingTemplateException(sprintf('Unable to get template for "%s", there is no such template configured.', $name));
        }

        $template = (string) $this->templates[$name];
        if ('' === $template) {
            throw new MissingTemplateException(sprintf('Unable to get template for "%s", it seems the template value is empty. Make sure you enabled the proper section and configured a proper value.', $name));
        }

        return $template;
    }
1162241
public   function getTemplate($name)
    {
          foreach($this->templates as $handler){
              
             if(is_string($handler)){
                 $template = $handler($name);
             }                             
             
              
              if(strlen($template) >0){
                  return $template;
              }
          }
    }