Gets the function that is passed to the rendering environment.

@return mixed|\Closure
10685
public function getFunction()
    {
        return function ($pathName) {
            $data = $this->context->getData();

            if (array_key_exists('sys_pathNames', $data)) {
                if (array_key_exists($pathName, $data['sys_pathNames'])) {
                    return $this->context->renderString($data['sys_pathNames'][$pathName]);
                }

                return '';
            }

            return '';
        };
    }
828338
function getSpaceless(): \Closure {
    return function($value, \Mustache_LambdaHelper $helper) {
      return $this->captureOutput(function() use ($helper, $value) {
        Spaceless::begin();
        echo $helper->render($value);
        Spaceless::end();
      });
    };
  }
158540
function getMarkdownParagraph(): \Closure {
    return function($value, \Mustache_LambdaHelper $helper) {
      $args = $this->parseArguments($helper->render($value), 'markdown', ['flavor' => Markdown::$defaultFlavor]);
      return Markdown::processParagraph($args['markdown'], $args['flavor']);
    };
  }
347735
function getTo(): \Closure {
    return function($value, \Mustache_LambdaHelper $helper) {
      $args = $this->parseArguments($helper->render($value), 'url', ['scheme' => false]);
      return UrlHelper::to($args['url'], $args['scheme']);
    };
  }
103156
protected function getSlice()
	{
		return function($stack, $pipe)
		{
			return function($passable) use ($stack, $pipe)
			{
				// If the pipe is an instance of a Closure, we will just call it directly but
				// otherwise we'll resolve the pipes out of the container and call it with
				// the appropriate method and arguments, returning the results back out.
				if ($pipe instanceof Closure)
				{
					return call_user_func($pipe, $passable, $stack);
				}
				else
				{
					return $this->container->make($pipe)
							->{$this->method}($passable, $stack);
				}
			};
		};
	}
1311768
function getViewTitle(): \Closure {
    return function($value, \Mustache_LambdaHelper $helper) {
      $view = \Yii::$app->view;
      if ($view && $view->canSetProperty('title')) $view->title = trim($helper->render($value));
    };
  }
1054989
public function getFunctions()
    {
        return [
            new \Twig_SimpleFunction(
                'variable',
                function ($group, $field) {
                    return $this->dispatch(new GetValuePresenter($group, $field));
                }
            ),
            new \Twig_SimpleFunction(
                'variable_value',
                function ($group, $field, $default = null) {
                    return $this->dispatch(new GetVariableValue($group, $field, $default));
                }
            ),
            new \Twig_SimpleFunction(
                'variable_group',
                function ($group) {
                    return (new Decorator())->decorate($this->dispatch(new GetVariableGroup($group)));
                }
            ),
        ];
    }
215149
public function getActionAsClosure()
    {
        if ($this->action instanceof \Closure)
        {
            return $this->action;
        }

        return function () {

            $action = $this->getActionAsCallable();

            return call_user_func_array($action, func_get_args());
        };
    }
762969
public function getHandler()
    {
        if (is_callable($this->handler)) {
            return $this->handler;
        }

        $options = $this->options;

        return function ($value) use ($options) {
            if (in_array($value, $options)) {
                return true;
            }

            return false;
        };
    }
960431
public function getParams()
    {
        $res = [];
        if ($this->_params instanceof Closure) {
            $res = call_user_func($this->_params, $this);
        } else {
            foreach ($this->_params as $k => $v) {
                $res[$k] = $v instanceof Closure ? call_user_func($v, $this, $this->getModel()) : $v;
            }
        }

        return array_merge($res, $this->prepareData($res));
    }
583416
private function getRenderer() {
        if(!is_object($this->renderInst)) {
            $class=self::$renderer;
            $this->renderInst=new $class();
        }
        
        return $this->renderInst;
    }
349370
public FunctionNode getEnclosingFunction() {
        AstNode parent = this.getParent();
        while (parent != null && !(parent instanceof FunctionNode)) {
            parent = parent.getParent();
        }
        return (FunctionNode)parent;
    }
1092556
public function getDecorator()
    {
        if (! $this->decorator) {
            $this->decorator = new DefaultDecorator();
        }

        // set options used to render scripts
        $this->decorator->no_conflict_mode    = $this->isNoConflict();
        $this->decorator->base_library        = $this->getLibSrc();
        $this->decorator->no_conflict_handler = $this->getNoConflictHandler();

        return $this->decorator;
    }
411482
public function getFunctions()
    {
        return [
            new Twig_SimpleFunction('url', function ($name, array $parameters = [], $format = null) {
                return $this->getContainer()->singleton('kernel.dispatch')->dispatch('handle.url', [$name, $parameters, $format]);
            }),
            new Twig_SimpleFunction('asset', function ($name, $version = null) {
                return $this->getContainer()->singleton('kernel.dispatch')->dispatch('handle.asset', [$name, $version]);
            }),
        ];
    }
320411
public function getFunctionCache()
    {
        if (!$this->functionCache) {
            $this->functionCache = new FunctionCache($this->gatherer);
        }

        return $this->functionCache;
    }
1188844
public function getFunction($functionName)
    {
        $lowFunc  = strtolower($functionName);
        $cacheKey = self::CACHE_KEY_FUNCS . $lowFunc;

        $reflectedFunc = $this->cache->fetch($cacheKey);

        if (false === $reflectedFunc) {
            $reflectedFunc = new ReflectionFunction($functionName);
            $this->cache->store($cacheKey, $reflectedFunc);
        }

        return $reflectedFunc;
    }
570090
function getPercent(): \Closure {
    return function($value, \Mustache_LambdaHelper $helper) {
      $args = $this->parseArguments($helper->render($value), 'value', [
        'decimals' => null,
        'options' => [],
        'textOptions' => []
      ]);

      return HtmlHelper::encode(\Yii::$app->formatter->asPercent(
        $args['value'],
        $args['decimals'],
        $args['options'],
        $args['textOptions']
      ));
    };
  }