Create an empty route with the given tag
@param string $tag
@return Route
972052
public function tag($tag)
    {
        $route = $this->factory->createRoute($this, null, array());

        $this->addRoute($route);

        return $route->tag($tag);
    }
621527
public function on(string $tag): Event
    {
        // Look for existing Event
        $event = $this->events[$tag] ?? null;
        if ($event) { // Found?
            return $event; // Return existing Event
        }

        // Register and return instance of new Event
        return $this->events[$tag] = new Event($this, $tag);
    }
950203
public static function withTag($tag)
    {
        $element = (new ReflectionClass(static::class))->newInstanceWithoutConstructor();

        $element->tag = $tag;
        $element->attributes = new Attributes();
        $element->children = new Collection();

        return $element;
    }
3995
public function setTag($tag)
    {
        if (in_array($tag, $this->getParent()->allowed_tags)) {
            throw new \Exception($tag.' can not be changed as it is not allowed under '.$this->getParent()->getTag().'.');
        }

        $this->tag = $tag;

        return $this;
    }
583703
public static function createTag($tag, $attributes, $content = null)
    {
        $tag = strtolower($tag);

        // Build list of arguments
        $preparedAttributes = '';
        foreach ($attributes as $attributeKey => $attributeValue) {
            // Only set non-empty strings (ensures strlen(0) > 0)
            if (strlen($attributeValue) > 0) {
                $preparedAttributes .= sprintf(
                    ' %s="%s"',
                    $attributeKey,
                    Convert::raw2att($attributeValue)
                );
            }
        }

        // Check void element type
        if (in_array($tag, static::config()->get('void_elements'))) {
            if ($content) {
                throw new InvalidArgumentException("Void element \"{$tag}\" cannot have content");
            }
            return "<{$tag}{$preparedAttributes} />";
        }

        // Closed tag type
        return "<{$tag}{$preparedAttributes}>{$content}</{$tag}>";
    }
711498
public function tag($tag)
    {
        $this->sys->exec(sprintf('git tag %s', $tag), 'Unable to create tag');
        $this->sys->exec('git push --tags', 'Unable to push tags');

        return $this;
    }
1242038
public function add($tag): self
    {
        if (is_string($tag)) {
            $tag = Url::create($tag);
        }

        if (! in_array($tag, $this->tags)) {
            $this->tags[] = $tag;
        }

        return $this;
    }
336767
public function _empty($tag,$content) {
        $name       =   $tag['name'];
        $name       =   $this->autoBuildVar($name);
        $parseStr   =   '<?php if(empty('.$name.')): ?>'.$content.'<?php endif; ?>';
        return $parseStr;
    }
486006
public function deleteMatchingTag($tag)
    {
        $this->collection->batchDelete(function (\Sokil\Mongo\Expression $e) use ($tag) {
            return $e->where(Cache::FIELD_NAME_TAGS, $tag);
        });
        
        return $this;
    }
963161
public function withTag($tag) {
        if (is_null($this->tags)) {
            $this->tags = [];
        }

        array_push($this->tags, $tag);
        return $this;
    }
54482
public function getTag($tag) {
        if (isset($this->_tags[$tag])) {
            return $this->_tags[$tag];
        }

        throw new MissingFilterException(sprintf('No filter can be found with %s tag', $tag));
    }
27908
public function append(Tag $tag) : Tag
    {
        if ($this->isVoid) {
            throw new \LogicException('Void elements cannot have any contents.');
        }

        $this->content .= $tag->render();

        return $this;
    }
454251
public function detachTag(Tag $tag)
    {
        if (!$this->hasTag($tag)) {
            throw new OutOfBoundsException('Tag '.$tag->getName().' is not attached');
        }

        $this->_tags = array_filter($this->_tags, function ($knownTag) use ($tag) {
            return $tag->getId() != $knownTag->getId();
        });

        return $this;
    }
488976
public function AddTag($tag)
    {
        $this->tag = $tag;
        $response = $this->doPost('/library/' . $this->mediaId . '/tag', [
            'tag' => [$tag]
        ]);

        $tags = $this->hydrate($response);
        foreach ($response['tags'] as $item) {
            $tag = new XiboLibrary($this->getEntityProvider());
            $tag->hydrate($item);
            $tags->tags[] = $tag;
        }
        return $this;
    }
218181
public function tag($tag)
	{
		$posts = $this->posts->activeByTag($tag, Config::get('wardrobe.per_page'));

		if ( ! $posts)
		{
			return App::abort(404, 'Page not found');
		}

		return View::make($this->theme.'.archive', compact('posts', 'tag'));
	}
425802
public function make($tag, $props = null, $content = null)
    {
        if (! isset($this->tagFactories[$tag])) {
            return Tag::create($tag, $props, $content, $this);
        }

        $constructor = $this->tagFactories[$tag];

        if (is_callable($constructor)) {
            /* @var $tag Tag */
            $tag = call_user_func($constructor, $props, $content, $this);
        } elseif (is_string($constructor) && class_exists($constructor)) {
            /* @var $tag Tag */
            $tag = new $constructor($props, $content, $this);
        }

        if (! $tag || ! $tag instanceof Tag) {
            throw  new \InvalidArgumentException(sprintf(
                'The constructor for the `%s` tag did not generate a Tag object',
                $tag
            ));
        }

        return $tag;

    }
530286
public function doGenerate($tag, array $parameters)
    {
        if (isset($parameters['siteaccess'])) {
            // We generate for a different siteaccess, so potentially in a different language.
            $languages = $this->configResolver->getParameter('languages', null, $parameters['siteaccess']);
            unset($parameters['siteaccess']);
        } else {
            $languages = $this->configResolver->getParameter('languages');
        }

        $tagUrl = '';
        $isInternal = false;
        $originalTagId = $tagId = $tag->id;

        try {
            do {
                $tag = $this->tagsService->loadTag($tagId, $languages);

                $tagKeyword = null;
                foreach ($languages as $language) {
                    $tagKeyword = $tag->getKeyword($language);
                    if (!empty($tagKeyword)) {
                        break;
                    }
                }

                if (empty($tagKeyword)) {
                    if ($tag->alwaysAvailable) {
                        $tagKeyword = $tag->getKeyword();
                    }

                    if (empty($tagKeyword)) {
                        throw new LogicException("Unknown error when generating URL for tag ID #{$originalTagId}");
                    }
                }

                $tagUrl = '/' . $tagKeyword . $tagUrl;

                $tagId = $tag->parentTagId;
            } while ($tagId > 0);
        } catch (NotFoundException $e) {
            $isInternal = true;
            $tagUrl = $this->defaultRouter->generate(
                self::INTERNAL_TAG_ROUTE,
                [
                    'tagId' => $originalTagId,
                ]
            );
        } catch (LogicException $e) {
            if ($this->logger !== null) {
                $this->logger->warning($e->getMessage());
            }

            $isInternal = true;
            $tagUrl = $this->defaultRouter->generate(
                self::INTERNAL_TAG_ROUTE,
                [
                    'tagId' => $originalTagId,
                ]
            );
        }

        $queryString = '';
        if (!empty($parameters)) {
            $queryString = '?' . http_build_query($parameters, '', '&');
        }

        return (!$isInternal ? $this->getPathPrefix() : '') . '/' . trim($tagUrl, '/') . $queryString;
    }