@param string $name
@param array $params

@return string
181038
public function renderArray($name, $params = [])
    {
        return $this->view($this->generator->generate($this->callbacks, $name, $params));
    }
853509
public function getUrl($name, $params = array())
	{
		if('http' === substr($name, 0, 4))
		{
			$domain = $name;
		}
		else
		{
			$domain = static::API_DOMAIN . $name;
		}
		return $domain . (empty($params) ? '' : ('?' . $this->http_build_query($params)));
	}
71173
public static function __callstatic($name, $params)
    {
        if (array_key_exists($name, TextColorManager::getKnownColors())) {
            return TextColorManager::$name($params);
        }

        if (BackgroundColorManager::isBackgroundCall($name)) {
            return BackgroundColorManager::$name($params);
        }

        if (in_array($name, BorderManager::getKnownBorders())) {
            return BorderManager::$name($params);
        }

        if (in_array($name, StructureManager::getDisplayableStructures())) {
            return StructureManager::$name($params);
        }

        if (array_key_exists($name, StyleManager::getKnownStyles())) {
            return StyleManager::$name($params);
        }

        if (FigletManager::isFigletCall($name)) {
            return FigletManager::$name($params);
        }

        throw new Exception("Unknown function name $name");
    }
490603
public static function callExtension($name, array $params = [])
    {
        $extension = static::getExtension($name);

        // call_user_func_array seems to be slow
        switch (count($params)) {
            case 0:
                return call_user_func($extension);
            case 1:
                return call_user_func($extension, $params[0]);
            case 2:
                return call_user_func($extension, $params[0], $params[1]);
            case 3:
                return call_user_func($extension, $params[0], $params[1], $params[2]);
            case 4:
                return call_user_func($extension, $params[0], $params[1], $params[2], $params[3]);
            default:
                return call_user_func_array($extension, $params);
        }
    }
985241
protected function storeSearchParams( array $params, $name )
	{
		$key = 'aimeos/admin/jqadm/' . $name;
		$session = $this->getContext()->getSession();

		if( isset( $params['filter'] ) ) {
			$session->set( $key . '/filter', $params['filter'] );
		}

		if( isset( $params['sort'] ) ) {
			$session->set( $key . '/sort', $params['sort'] );
		}

		if( isset( $params['page'] ) ) {
			$session->set( $key . '/page', $params['page'] );
		}

		if( isset( $params['fields'] ) ) {
			$session->set( $key . '/fields', $params['fields'] );
		}

		return [
			'fields' => $session->get( $key . '/fields' ),
			'filter' => $session->get( $key . '/filter' ),
			'page' => $session->get( $key . '/page' ),
			'sort' => $session->get( $key . '/sort' ),
		];
	}
551624
private function migrate($name, $params = [])
    {
        $generator = new TemplateGenerator();
        $generator->setContent(file_get_contents($name));

        return $generator->generate($params);
    }
537189
public function param($name = '')
    {
        switch ($this->method) {
            case 'POST':
                $data = $this->post();
                break;
            case 'GET':
                $data = $this->get();
                break;
        }

        if (empty($name)) {
            return $data;
        } else {
            return isset($data[$name]) ? $data[$name] : null;
        }
    }
1216294
public function widget($name, array $params = [])
    {
        if (!isset($this->widgets[$name])) {
            throw new \InvalidArgumentException(sprintf('A widget by the name "%s" not exist.', $name));
        }

        $widget = $this->widgets[$name];

        return $widget($params);
    }
855862
public function get(string $name, ...$params) {
        if ($this->created->containsKey($name)) return $this->created->getNodeByKey($name)->getValue();
        if ($this->instances->containsKey($name)) return $this->fromInstances($name, $params);

        try {
            $reflectionClass = new ReflectionClass($name);
            $constructor = $reflectionClass->getConstructor();
            $parameters = [];

            if (null !== $constructor) {
                /** @var ReflectionParameter $parameter */
                foreach ($constructor->getParameters() as $parameter) {
                    $className = $parameter->getClass()->getName();
                    $class = $this->get($className);
                    if (null === $class) throw new ClassNotFoundException();
                    $parameters[] = $class;
                }
            }
            $clazz = $reflectionClass->newInstanceArgs($parameters + $params);
            $this->created->add($name, $clazz);
            return $clazz;
        } catch (Exception $exception) {
            return null;
        }
    }
1144802
private function prepareArrayQuery(string $param_name, array $params): array
    {
        $params_name = [];
        $params_val = [];
        
        foreach ($params as $key => $val) {
            $name = ':' . 'arr_' . $key;
            $params_name[] = $name;
            $params_val[$name] = $val;
        }
        
        $sql = implode(', ', $params_name);
        
        str_replace($param_name, $sql, $this->sql);
        array_merge($this->params, $params_val);
        
        return [
            'sql' => $sql,
            'values' => $params_val
        ];
    }
1076018
private function getFullName(array $params): string
    {
        if (isset($params['full_name'])) {
            return $this->get($params, 'full_name', '');
        }

        return trim(sprintf('%s %s', $this->get($params, 'first', ''), $this->get($params, 'last', '')));
    }
1138433
protected function hasParameter(array $params, $name, $value = null)
    {
        $found = in_array($name, $params);
        if (is_null($value) || !$found) {
            return $found;
        }
        $paramValueIndex = array_search($name, $params) + 1;
        return isset($params[$paramValueIndex]) && ($params[$paramValueIndex] == $value);
    }
959312
public function render($name, array $params = [])
	{
		$latte = $this->createLatteEngine();
		$basePath = ['basePath' => $this->getBasePath()] ;
		$latte->render($name, $params + $basePath);
		return $latte;
	}
979913
protected function getQueryParams(array $params = []): string
    {
        if (empty($params)) {
            return '';
        }
        $query = $params['query'] ?? [];
        if (is_string($query)) {
            return $query;
        }
        return empty($query) ? '' : http_build_query($query);
    }
686272
public static function __callstatic($name, $params)
    {
        if (!in_array($name, static::getKnownBorders())) {
            throw new Exception("Unknown border function name $name");
        }

        // target string is expected to be:
        $targetString = $params[0][0];
        $functionName = '__' . $name;

        return static::$functionName($targetString);
    }
706173
public static function __callstatic($name, $params)
    {
        if (!in_array($name, static::getDisplayableStructures())) {
            throw new Exception("Unknown structure function name $name");
        }

        // target string is expected to be:
        $target       = $params[0][0];
        $functionName = '__' . $name;

        return static::$functionName($target);
    }
1047167
public static function linkRoute($name, $params = array(), $url = null)
    {
        //starting defining url and qs
        $url = ($url != '') ? $url : $_SERVER["REQUEST_URI"];
        $url_arr = explode('?', $url);
        $url = $url_arr[0];
        $qs = (isset($url_arr[1])) ? $url_arr[1] : '';
        if (!is_array($params)) $params = (array) $params;
        
        //is a stric-uri?
        if (isset(self::$routes[$name][0]) and self::$routes[$name][0]=== '^') {
            $is_strict = true;
            $route = self::$routes[$name];
            //in this case remove conditional patterns
            $url = self::parsePattern($route, true);

            //we remove also conditional atoms
            $url = preg_replace('#\(.*\)\?#', '', $route);

            $url = ltrim($url, '^');
            $url = rtrim($url, '$');
            if (preg_match_all('#\(.*\)#U',$url, $matches)) {
                foreach ($params as $key=>$param) {
                    $url = str_replace($matches[0][$key],$param, $url);
                }
            }
            
            if (self::$qs[$name]) {
                $qs = preg_replace('#(&?)'.self::$qs[$name].'#', '', $qs);
            }
            
        //non strict route
        } else {
            $is_strict = false;
            
            //If required we remove other routes (from segments and qs)
            if (count(self::$remove[$name])) {

                foreach (self::$remove[$name] as $route) {

                    if (self::$routes[$route]) {
                        $url = preg_replace('#(\/?)'.self::$routes[$route].'#', '', $url);
                    }
                    if (self::$qs[$route]) {
                        $qs = preg_replace('#(&?)'.self::$qs[$route].'#', '', $qs);
                    }

                }
            }

            //if this route works with uri
            //I check for all params to build the append segment with given params,
            //then I strip current rule and append new one.
            if (self::$routes[$name]) {
                $append =  self::$routes[$name];
                if (preg_match_all('#\(.*\)#U',$append, $matches)) {
                    foreach ($params as $key=>$param) {
                        $append = str_replace($matches[0][$key],$param, $append);
                    }
                }
                $url = preg_replace('#(\/?)'.self::$routes[$name].'#', '', $url);
                $url = $url."/".$append;
                $url = str_replace('//','/',$url);

            }
            
        }

        
        //if this route works on query string
        //I check for all params to buid and "append" or "replace" query string with given params.
        $append = '';
        if (self::$qs[$name]) {
            $append =  self::$qs[$name];
            if (preg_match_all('#\(.*\)#U',$append, $matches)) {
                foreach ($params as $key=>$param) {
                    $append = str_replace($matches[0][$key],$param, $append);
                }
            }
            $qs = preg_replace('#(&?)'.self::$qs[$name].'#', '', $qs);
            $qs = str_replace('&&','&',$qs);
            $qs = rtrim($qs, '&');
            $qs =  $qs .'&'.$append;
            $qs = ltrim($qs, '&');

        }
        if ($is_strict == true) $qs = $append;
        if ($qs != '') $qs = '?'.$qs;
        if ($url == '') $url = '/';
        return $url.$qs;
    }