@param       $access_name
@param       $text
@param       $url
@param array $attrs

@return $this
357332
function addItem($as, $key, $route_parameters = []) {
        if (is_string($as)) {
            if (!Route::isEnable($as)) {
                return $this;
            }
            if (Route::checkRouteFilters($as)) {
                return $this;
            }
            if (!count(Route::get($as))) {
                return $this;
            }
        }


        if (is_array($as)) {
            $text = Arr::get(
                $as,
                'title'
            );
            $icon = Arr::get(
                $as,
                'icon'
            );
            $url  = Arr::get(
                $as,
                'url',
                '#'
            );
            $as   = Arr::get(
                $as,
                'as'
            );
        } else {
            $keys = array_keys($route_parameters);
            $keys = array_map(
                function ($item) {
                    return '{' . $item . '}';
                },
                $keys
            );

            $text = str_replace($keys, array_values($route_parameters), Route::get_title($as));
            $icon = Route::get_icon($as);
            $url  = \URL::route($as, $route_parameters);
        }
        if ($icon) {
            $text = \HtmlI::setTitle($text)->addClass($icon) . ' &nbsp;' . \HtmlSpan::setContent($text);
        }
        if (!isset($this->maps[$this->section])) {
            $this->maps[$this->section] = Map::instance(get_called_class() . $this->name . $this->section);
        }
        if ($route_parameters) {
            $key .= '.'.str_replace(['&', '='], ['.', '-'], http_build_query($route_parameters));
        }
        $this->maps[$this->section]->add(
            $key,
            $as,
            $text,
            $url
        );

        return $this;
    }
1072206
public function open(String $name = NULL, Array $_attributes = [])
    {
        $this->clearValidationSessions();

        $this->setFormName($name, $_attributes);

        $this->isEnctypeAttribute($_attributes);
       
        $this->isWhereAttribute($name);
        
        $this->isQueryAttribute();

        $this->isPreventAttribute();
        
        $this->setMethodType($_attributes);
        
        $this->createFormElementByAttributes($_attributes, $return);

        $this->isDatabaseProcessWithName($name, $return);

        $this->isCSRFAttribute($return);

        $this->_unsetopen();

        $this->outputElement .= $return;

        return $this;
    }
909473
public function setAccessToken(AccessToken $accessToken)
    {
        if (!$accessToken->isValid()) {
            $accessToken->refresh();
        }

        $this->accessToken = $accessToken;
    }
257577
public function set_session($attr){
    if ( $this->session->has(self::$un) ){
      $args = \func_get_args();
      if ( (\count($args) === 2) && \is_string($args[0]) ){
        $attr = [$args[0] => $args[1]];
      }
      foreach ( $attr as $key => $val ){
        if ( \is_string($key) ){
          $this->session->set($val, self::$un, $key);
        }
      }
    }
    return $this;
  }
1047234
function autoCreateParent($access_name, $url) {
        $path          = str_replace('.', '._items_.', $access_name);
        $arr           = explode('.', $access_name);
        $tmp           = array_pop($arr);
        $default_title = ucwords(str_replace('_', ' ', $tmp));
        if(!Arr::get($this->items, $path . '._items_')) {
            Arr::set($this->items, $path . '._items_', []);
        }
        Arr::set($this->items, $path . '.access_name', $access_name);
        if(!Arr::get($this->items, $path . '.text')) {
            Arr::set($this->items, $path . '.text', $default_title);
        }
        if(!Arr::get($this->items, $path . '.url')) {
            Arr::set($this->items, $path . '.url', null);
        }
        if(!Arr::get($this->items, $path . '.icon')) {
            Arr::set($this->items, $path . '.icon', null);
        }
        if(!Arr::get($this->items, $path . '.childs')) {
            Arr::set($this->items, $path . '.childs', []);
        }
        if(!Arr::get($this->items, $path . '.labels')) {
            Arr::set($this->items, $path . '.labels', []);
        }
        if($url) {
            $childs   = Arr::get($this->items, $path . '.childs');
            $childs[] = $url;
            $childs   = array_unique($childs);
            Arr::set($this->items, $path . '.childs', $childs);
        }
    }
279542
public function link($url, $title, $attributes = [])
    {
        $attributes['href'] = $url;
        $tag = new Tag('a', $attributes);
        $tag->setText($title);
        return $tag;
    }
1139129
private static function element($name, array $attrs)
    {
        $str = "<$name";

        foreach ($attrs as $name => $value) {
            if ($value === null) {
                continue;
            } elseif ($value === true) {
                $str .= " $name";
            } elseif ($value !== false) {
                $str .= ' '.$name.'="'.htmlspecialchars($value).'"';
            }
        }

        return "$str>";
    }
1085105
protected function createAccessor(
        $accessor,
        string $name,
        $value,
        array $context = []
    ): AccessorInterface {
        //Giving ORM as context
        return parent::createAccessor($accessor, $name, $value, $context + ['orm' => $this->orm]);
    }
1186322
public function setAccessor(
        Context $context,
        NameValue $name,
        callable $getter,
        callable $setter = null,
        int $settings = AccessControl::DEFAULT_ACCESS,
        int $attributes = PropertyAttribute::NONE
    ): bool {
    }
159804
public static function a($path, $text = NULL, $base_path = true, array $attrs = array())
    {
        if($base_path)
            $path = self::getBaseSite() . ltrim($path, '/');
        $attrs['href'] = $path;
            
        return self::tag('a', $text, false, false, $attrs);
    }
375568
public function create(string $content, $url, array $attributes = []) : string
    {
        return $this->make(new HrefSettings([
            'content'   => $content,
            'url'       => $url,
            'attributes'=> $attributes,
        ]));
    }
553139
public static function submit($text, $attributes = array())
    {
        if (isset($attributes['name'])) {
            $name = $attributes['name'];
            unset($attributes['name']);
        } else {
            $name = 'submit';
        }

        return self::input('submit', $name, array_merge(array('value' => $text), $attributes));
    }
198108
private function setVarStartHandler(array $attrs): void
    {
        if (empty($attrs['name'])) {
            throw new DomainException('REPORT ERROR var: The attribute "name" is missing or not set in the XML file');
        }

        $name  = $attrs['name'];
        $value = $attrs['value'];
        $match = [];
        // Current GEDCOM record strings
        if ($value === '@ID') {
            if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
                $value = $match[1];
            }
        } elseif ($value === '@fact') {
            $value = $this->fact;
        } elseif ($value === '@desc') {
            $value = $this->desc;
        } elseif ($value === '@generation') {
            $value = (string) $this->generation;
        } elseif (preg_match("/@(\w+)/", $value, $match)) {
            $gmatch = [];
            if (preg_match("/\d $match[1] (.+)/", $this->gedrec, $gmatch)) {
                $value = str_replace('@', '', trim($gmatch[1]));
            }
        }
        if (preg_match("/\\$(\w+)/", $name, $match)) {
            $name = $this->vars["'" . $match[1] . "'"]['id'];
        }
        $count = preg_match_all("/\\$(\w+)/", $value, $match, PREG_SET_ORDER);
        $i     = 0;
        while ($i < $count) {
            $t     = $this->vars[$match[$i][1]]['id'];
            $value = preg_replace('/\$' . $match[$i][1] . '/', $t, $value, 1);
            $i++;
        }
        if (preg_match('/^I18N::number\((.+)\)$/', $value, $match)) {
            $value = I18N::number((int) $match[1]);
        } elseif (preg_match('/^I18N::translate\(\'(.+)\'\)$/', $value, $match)) {
            $value = I18N::translate($match[1]);
        } elseif (preg_match('/^I18N::translateContext\(\'(.+)\', *\'(.+)\'\)$/', $value, $match)) {
            $value = I18N::translateContext($match[1], $match[2]);
        }

        // Arithmetic functions
        if (preg_match("/(\d+)\s*([\-\+\*\/])\s*(\d+)/", $value, $match)) {
            // Create an expression language with the functions used by our reports.
            $expression_provider  = new ReportExpressionLanguageProvider();
            $expression_cache     = new NullAdapter();
            $expression_language  = new ExpressionLanguage($expression_cache, [$expression_provider]);

            $value = (string) $expression_language->evaluate($value);
        }

        if (strpos($value, '@') !== false) {
            $value = '';
        }
        $this->vars[$name]['id'] = $value;
    }
464042
protected TextAccessor accessor(
        AttributeQuery attributes,
        OutputContext outputContext,
        boolean leap
    ) {

        Locale lang = attributes.get(Attributes.LANGUAGE, Locale.ROOT);
        TextWidth textWidth = attributes.get(Attributes.TEXT_WIDTH, TextWidth.WIDE);
        CalendarText cnames = CalendarText.getInstance(this.getCalendarType(attributes), lang);

        if (this.isMonthElement()) {
            if (leap) {
                return cnames.getLeapMonths(textWidth, outputContext);
            } else {
                return cnames.getStdMonths(textWidth, outputContext);
            }
        } else if (this.isWeekdayElement()) {
            return cnames.getWeekdays(textWidth, outputContext);
        } else if (this.isEraElement()) {
            return cnames.getEras(textWidth);
        } else {
            return cnames.getTextForms(this.name(), this.type);
        }

    }
20748
public function set_row_attribs($attr = array(), $index = null)
    {
        if (is_string($attr)) {
            $attr = array('class' => $attr);
        }

        if ($index === null) {
            $index = $this->rowindex;
        }

        // make sure row object exists (#1489094)
        if (!$this->rows[$index]) {
            $this->rows[$index] = new stdClass;
        }

        $this->rows[$index]->attrib = $attr;
    }
1229214
public static function link($url, $text, array $attributes = null) {
        $attributes = (array)$attributes;
        $attributes['href']  = $url;
        return self::tag('a', $text, $attributes);
    }
414319
protected function addAttribute(Tag $tag, $attrName)
	{
		$isUrl = false;
		$exprs = [];
		foreach ($this->captures as $key => $capture)
		{
			if ($capture['name'] !== $attrName)
			{
				continue;
			}
			$exprs[] = $capture['expr'];
			if (isset($this->references['asUrl'][$key]))
			{
				$isUrl = true;
			}
		}
		$exprs = array_unique($exprs);

		$regexp = $this->delimiter . '^';
		$regexp .= (count($exprs) === 1) ? $exprs[0] : '(?:' . implode('|', $exprs) . ')';
		$regexp .= '$' . $this->delimiter . 'D' . $this->modifiers;

		$attribute = $tag->attributes->add($attrName);

		$filter = $this->configurator->attributeFilters['#regexp'];
		$filter->setRegexp($regexp);
		$attribute->filterChain[] = $filter;

		if ($isUrl)
		{
			$filter = $this->configurator->attributeFilters['#url'];
			$attribute->filterChain[] = $filter;
		}
	}