Remove tag.
Removes specified tag from the specified layout
@param string $tag name of the taf to remove
@return XiboLayout
770877
public function removeTag($tag)
    {
        $this->tag = $tag;
        $this->getLogger()->info('Removing tag: ' . $tag . ' from layout ID ' . $this->layoutId);
        $this->doPost('/layout/' . $this->layoutId . '/untag', [
            'tag' => [$tag]
        ]);

        return $this;
    }
712194
public function purgeUrlsByTag(string $tag)
    {
        try {
            if ($urls = $this->getTaggedUrls($tag)) {

                $this->purgeUrls(array_values($urls));
                $this->invalidateLocalCache(array_keys($urls));

                return true;
            }
        } catch (Exception $e) {
            \Craft::warning("Failed to purge '$tag'.", "upper");
        }

        return false;
    }
152484
public function purgeTag(string $tag)
    {
        $this->log("Dummy::purgeTag($tag) was called.");

        if ($this->useLocalTags) {
            $this->purgeUrlsByTag($tag);
        }

        return true;
    }
616925
public static void remove(Tag tag) {
	Body body = (Body) tag.getParent();
	body.getStatements().remove(tag);
    }
156813
public function removeByTag($tag)
    {
        $tags = (array) $tag;

        if (0 == count($tags)) {
            return false;
        }

        try {
            $this->_repository
                    ->createQueryBuilder('c')
                    ->delete()
                    ->where('c._tag IN (:tags)')
                    ->setParameters(array('tags' => $this->getContextualTags($tags)))
                    ->getQuery()
                    ->execute();
            $this->resetCacheEntity();
        } catch (\Exception $e) {
            $this->log('warning', sprintf('Enable to remove cache for tags (%s) : %s', implode(',', $tags), $e->getMessage()));

            return false;
        }

        return true;
    }
381418
protected static function removeFragment($template, $tag)
    {
        $fragment = self::fetchFragment($template, $tag);

        return !empty($fragment) ? str_replace($fragment, '', $template) : $template;
    }
213009
public static function taggify($tag)
    {
        $filters = config('lecturize.tags.filters', []);
        $tag = trim(str_replace(array_keys($filters), array_values($filters), $tag));

        $patterns = config('lecturize.tags.patterns', ['/\(([^)]+)\)/' => '']);
        $tag = trim(preg_replace(array_keys($patterns), array_values($patterns), $tag));

        if (config('lecturize.tags.camel_case', false)) {
            $tag = camel_case($tag);
            $tag = ucfirst($tag);
        }

        $tag = trim($tag);

        return $tag;
    }
43123
public function addTag($tag)
    {
        $this->tags[] = (string)$tag;
        $this->ref = null;
        return $this;
    }
635977
public function untag($tags = null)
    {
        $tags = $tags ?: $this->tags->pluck('name')->all();

        foreach ($this->prepareTags($tags) as $tag) {
            $this->removeTag($tag);
        }

        return true;
    }
87025
public function onReplace($tag)
    {
        $chunks = trimsplit('::', $tag);

        if ('news_categories' === $chunks[0]) {
            /** @var Input $input */
            $input = $this->framework->getAdapter(Input::class);

            if ($alias = $input->get($this->manager->getParameterName())) {
                /** @var NewsCategoryModel $model */
                $model = $this->framework->getAdapter(NewsCategoryModel::class);

                if (null !== ($category = $model->findPublishedByIdOrAlias($alias))) {
                    $value = $category->{$chunks[1]};

                    // Convert the binary to UUID for images (#147)
                    if ($chunks[1] === 'image' && $value) {
                        return StringUtil::binToUuid($value);
                    }

                    return $value;
                }
            }
        }

        return false;
    }
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;
    }
577003
public function col_controls($tag) {
        global $OUTPUT, $PAGE;
        $o = '';
        // Edit.
        $url = new moodle_url('/tag/edit.php', array('id' => $tag->id, 'returnurl' => $PAGE->url->out_as_local_url()));
        $o .= $OUTPUT->action_icon($url, new pix_icon('t/edit', get_string('edittag', 'tag')));
        // Delete.
        $url = new moodle_url($this->baseurl, array('action' => 'delete',
            'tagid' => $tag->id, 'sesskey' => sesskey()));
        $o .= $OUTPUT->action_icon($url, new pix_icon('t/delete', get_string('delete', 'tag')),
                null, array('class' => 'action-icon tagdelete'));
        return $o;
    }
875127
public function destroy(TagRequest $request, Tag $tag)
    {
        try {

            $tag->delete();
            return $this->response->message(trans('messages.success.deleted', ['Module' => trans('blog::tag.name')]))
                ->code(202)
                ->status('success')
                ->url(guard_url('blog/tag/0'))
                ->redirect();

        } catch (Exception $e) {

            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('blog/tag/' . $tag->getRouteKey()))
                ->redirect();
        }

    }
807791
public function removeNoSlashTag($tag): Dom
    {
        if ( ! is_array($tag)) {
            $tag = [$tag];
        }
        $this->noSlash = array_diff($this->noSlash, $tag);

        return $this;
    }
1003634
public function detachTags($tags)
    {
        $tags = static::convertToTags($tags);

        collect($tags)
            ->filter()
            ->each(function (Tag $tag) {
                $this->tags()->detach($tag);
            });

        return $this;
    }
943811
public function removeAll( $tag, $priority = false ) {
		if ( isset( $this->hooks[$tag] ) ) {
			if ( false !== $priority && isset( $this->hooks[$tag][$priority] ) )
				unset( $this->hooks[$tag][$priority] );
			else
				unset( $this->hooks[$tag] );
		}

		if ( isset( $this->merged[$tag] ) )
			unset( $this->merged[$tag] );

		return true;
	}
853009
public function getTag($tag)
    {
        if (!isset($this->tags[ $tag ])) {
            throw new \OutOfBoundsException("Tag {$tag} does not exist.");
        }

        return $this->tags[ $tag ];
    }