Set the tag name.

@return Bluora\LaravelHtmlBuilder\Tag
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;
    }
835016
public function generate()
    {
        return sprintf(
            '<%s %s>%s</%s>%s',
            $this->tag,
            parent::generate(),
            $this->label,
            $this->tag,
            PHP_EOL
        );
    }
14536
public function getName() {
		$tagNames = array(
			T_NEW_LINE             => 'T_NEW_LINE',
			T_TAB                  => 'T_TAB',
			T_SEMICOLON            => 'T_SEMICOLON',
			T_BRACES_OPEN          => 'T_BRACES_OPEN',
			T_BRACES_CLOSE         => 'T_BRACES_CLOSE',
			T_PARENTHESIS_OPEN     => 'T_PARENTHESIS_OPEN',
			T_PARENTHESIS_CLOSE    => 'T_PARENTHESIS_CLOSE',
			T_COMMA                => 'T_COMMA',
			T_EQUAL                => 'T_EQUAL',
			T_CONCAT               => 'T_CONCAT',
			T_COLON                => 'T_COLON',
			T_MINUS                => 'T_MINUS',
			T_PLUS                 => 'T_PLUS',
			T_IS_GREATER           => 'T_IS_GREATER',
			T_IS_SMALLER           => 'T_IS_SMALLER',
			T_MULTIPLY             => 'T_MULTIPLY',
			T_DIVIDE               => 'T_DIVIDE',
			T_QUESTION_MARK        => 'T_QUESTION_MARK',
			T_MODULO               => 'T_MODULO',
			T_EXCLAMATION_MARK     => 'T_EXCLAMATION_MARK',
			T_AMPERSAND            => 'T_AMPERSAND',
			T_SQUARE_BRACKET_OPEN  => 'T_SQUARE_BRACKET_OPEN',
			T_SQUARE_BRACKET_CLOSE => 'T_SQUARE_BRACKET_CLOSE',
			T_AROBAS               => 'T_AROBAS',
			T_UNKNOWN              => 'T_UNKNOWN',
			T_DOLLAR               => 'T_DOLLAR',
		);

		if (isset($tagNames[$this->id])) {
			$result = $tagNames[$this->id];
		} else {
			$result = token_name($this->id);
		}

		return $result;
	}
1180816
protected function setTagsHints()
	{
		$this->hints['attributeDefaultValue'] = 0;
		$this->hints['namespaces']            = 0;
		foreach ($this->config['tags'] as $tagName => $tagConfig)
		{
			$this->hints['namespaces'] |= (strpos($tagName, ':') !== false);
			$this->setTagAttributesHints($tagConfig);
		}
	}
616026
public function set_related_tags($tagnames) {
        $context = context_system::instance();
        $tagobjects = $tagnames ? static::create_if_missing($this->tagcollid, $tagnames) : array();
        unset($tagobjects[$this->name]); // Never link to itself.

        $currenttags = static::get_item_tags('core', 'tag', $this->id);

        // For data coherence reasons, it's better to remove deleted tags
        // before adding new data: ordering could be duplicated.
        foreach ($currenttags as $currenttag) {
            if (!array_key_exists($currenttag->name, $tagobjects)) {
                $taginstance = (object)array('id' => $currenttag->taginstanceid,
                    'itemtype' => 'tag', 'itemid' => $this->id,
                    'contextid' => $context->id);
                $currenttag->delete_instance_as_record($taginstance, false);
                $this->delete_instance('core', 'tag', $currenttag->id);
            }
        }

        foreach ($tagobjects as $name => $tag) {
            foreach ($currenttags as $currenttag) {
                if ($currenttag->name === $name) {
                    continue 2;
                }
            }
            $this->add_instance('core', 'tag', $tag->id, $context, 0);
            $tag->add_instance('core', 'tag', $this->id, $context, 0);
            $currenttags[] = $tag;
        }
    }
755450
public function setAttributes(array $attributes) : Tag
    {
        foreach ($attributes as $name => $value) {
            $this->attributes[strtolower($name)] = (string) $value;
        }

        return $this;
    }
1049832
public function getTag() {
		if($this->exists()) {
			$url = $this->getURL();
			$title = ($this->Title) ? $this->Title : $this->Filename;
			if($this->Title) {
				$title = Convert::raw2att($this->Title);
			} else {
				if(preg_match("/([^\/]*)\.[a-zA-Z0-9]{1,6}$/", $title, $matches)) {
					$title = Convert::raw2att($matches[1]);
				}
			}
			return "<img src=\"$url\" alt=\"$title\" ".$this->getAttributesHTML()." />";
		}
	}
246477
public function getTags() {
        return implode(",", array_keys(ArrayHelper::map($this->owner->getModelTags()->asArray()->all(), 'name', 'name')));
    }
110403
protected function setTagName($tagName)
	{
		if (!property_exists($this, 'tagName'))
		{
			throw new RuntimeException("Unknown property 'tagName'");
		}

		$this->tagName = TagName::normalize($tagName);
	}
1054531
public function attachTag(Tag $tag)
    {
        if (!$this->hasTag($tag)) {
            $this->_tags[] = $tag;
        }

        return $this;
    }
1001707
public function setName($name)
    {
        $this->name = $name;
        $this->setValue($this->form->getFieldValue($this->name));
        return $this;
    }
297509
protected function setActionTags()
    {
        $form = $this->xml->getElementsByTagName('form')->item(0);
        $div = $this->xml->createElement('div');

        $input = $this->xml->createElement('input');
        $input->setAttribute('type', 'hidden');
        $input->setAttribute('name', 'ext');
        $input->setAttribute('value', $this->owner->name);
        $div->appendChild($input);

        $input = $this->xml->createElement('input');
        $input->setAttribute('type', 'hidden');
        $input->setAttribute('name', 'form');
        $input->setAttribute('value', $this->name);
        $div->appendChild($input);

        $form->appendChild($div);
    }
1266244
public function tag($tagNames)
    {
        $tagNames = static::$taggingUtility->makeTagArray($tagNames);

        foreach($tagNames as $tagName) {
            $this->addTag($tagName);
        }
    }
534592
public function getTag($tagName)
    {
        foreach ($this->tags as $tag) {
            if ($tag['name'] === $tagName) {
                return $tag;
            }
        }

        throw new \InvalidArgumentException(sprintf(
            'Unknown tag "%s"', $tagName
        ));
    }
58174
protected function tagCharset()
	{
		// Get the default value in config file if not manually defined
		$charset = ($this->charset) ? $this->charset : $this->getConfig('charset');
		
		// Don't return any tag if value is empty
		if ($charset)
		{
			return '<meta charset="'.$charset.'">' . "\n\t";
		}
	}
1116158
public function getOpeningTag(): string
    {
        $attributes = [];

        foreach ($this->attributes as $name => $value) {
            $attributes[] = self::getHtmlAttribute($name, $value);
        }

        $attributes = implode(' ', array_filter($attributes));

        return sprintf('<%s%s>', $this->nodeName, $attributes === '' ? '' : " {$attributes}");
    }
369660
public function setTag(array $tag)
    {
        $this->validateInput(
            $tag,
            $this->validator,
            'validateTag',
            $this->exception,
            'Provided tag array is not a valid value.'
        );

        foreach ($tag as $tagName) {
            self::$xml['tag'] .= '<video:tag>'.$tagName.'</video:tag>';
        }

        return $this;
    }