Adds content inside of a tag and places it in the last slot,
NOTE: performing this will automatically add a closing tag.
@param   self|string   $content
@return  HTMLTag
@throws  HTMLTagException
967332
public function appendContent($content)
    {
        if(!is_string($content) && !($content instanceof self))
        {
            throw new HTMLTagException("Only HTMLTags and strings are allowed as content.");
        }

        $this->tag_content[] = $content;

        $this->setClosingTag(true);

        return $this;
    }
285553
public function prependContent($content)
    {
        if ($this->isVoid) {
            throw new Exception\RuntimeException(
                'Void elements can\'t contain content.'
            );
        }

        $this->content = $content . $this->content;

        return $this;
    }
972070
public function setHtml(string $html): self
    {
        return $this->addPart(Part::create($html, 'text/html'), true);
    }
273225
public function content($content, $contentType = self::CONTENT_TYPE_HTML, $charset = null)
    {
        $this->getSwiftMessage()->setBody($content, $contentType, $charset);

        return $this;
    }
1134621
protected function append( string$content ):self
	{
		if( $this->currentSection ){
			$this->currentSection->append($content);
		}else{
			$this->content.=$content;
		}

		return $this;
	}
622230
public function setHtmlContent(string $content) : Tag
    {
        if ($this->isVoid) {
            throw new \LogicException('Void elements cannot have any contents.');
        }

        $this->content = $content;

        return $this;
    }
354496
public function addContent(string $content): \Symfony\Component\HttpFoundation\Response
    {
        return $this->setContent($this->getContent() . $content);
    }
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;
    }
601568
protected function setContent($content)
    {
        $this->content = (string) $content;

        if (empty($this->content)) {
            throw new \Exception('Header content is empty !');
        }

        return $this;
    }
163156
public static function createTag($tag, $htmlOptions = null, $content = null)
    {
        $return = '';
        $tag = self::clearAttributeKey(trim($tag));
        if ($tag) {
            $attributes = self::createAttributeString($htmlOptions);
            $return = '<' . $tag . (!empty($attributes) ? ' ' . $attributes : '');
            if ($content === false) {
                $return .= '>';
            } elseif ($content === true) {
                $return .= '>';
            } else {
                $return .= '>' . $content . self::createCloseTag($tag);
            }
        }

        return $return;
    }
511277
public function row($content)
    {
        if ($content instanceof Closure) {
            $row = new Row();
            call_user_func($content, $row);
            $this->addRow($row);
        } else {
            $this->addRow(new Row($content));
        }

        return $this;
    }
582648
public static function createFromContent($content)
    {
        $domDocument = new \DOMDocument();

        @$domDocument->loadHTML($content);

        $xpathQueryBuilder = new XpathQueryBuilder();

        $xpathQueryBuilder->setDomXpath(new \DOMXPath($domDocument));

        return $xpathQueryBuilder;
    }
1252468
public function setContent( $content ) {
		$this->original = $content;

		if ( $this->should_be_json( $content ) ) {
			$this->header( 'Content-Type', 'application/json' );

			$content = $this->prepare_json_content( $content );
		}

		parent::setContent( $content );

		return $this;
	}
133113
public function _foreach($tag,$content) {
        $name       =   $tag['name'];
        $item       =   $tag['item'];
        $key        =   !empty($tag['key'])?$tag['key']:'key';
        $name       =   $this->autoBuildVar($name);
        $parseStr   =   '<?php if(is_array('.$name.')): foreach('.$name.' as $'.$key.'=>$'.$item.'): ?>';
        $parseStr  .=   $this->tpl->parse($content);
        $parseStr  .=   '<?php endforeach; endif; ?>';

        if(!empty($parseStr)) {
            return $parseStr;
        }
        return ;
    }
563065
protected function htmlContent($content)
    {
        try {

            $this->getMbAudit()->setResponseType('html');

            if ($content instanceof \Exception) {

                throw $content;

            } elseif ($content instanceof \SplFileInfo && !$this->getMbRequest()->isBlogAdmin()) {

                $this->downloadFile($content);

            } elseif (!is_string($content) && !$content instanceof Renderable) {

                $this->getMbAudit()->setResponseType('debug');
                $this->getMbAudit()->setResponseData($content);

                ob_start();
                (new Dumper)->dump($content);
                $this->original = ob_get_contents();
                ob_end_clean();

            } else {

                $this->getMbAudit()->setResponseData($content);
                $this->original = $content;

            }

            parent::setContent($this->original);

        } catch (\Exception $e) {

            $this->getMbAudit()->setResponseData($e->getMessage());

            if ($this->getMbRequest()->isBlogAdmin()) {
                $this->adminNotice($e->getMessage(), 'error');
            } else {
                $this->original = "<strong>Erro:</strong> {$e->getMessage()}<br>";
            }

            parent::setContent($this->original);
        }
    }
1228420
public function text($content = '')
    {
        $this->format = 'text';

        if (! str_empty($content)) {
            $this->content($content);
        }

        return $this;
    }
668963
public function add($content)
    {
        // Load
        $json = $this->load();

        // Create JSON elements Array:
        foreach ($content["elements"] as $key => $value) {
            // delete columns and labels of irre-fields from elements
            if ($key == "columns" || $key == "labels") {
                foreach ($value as $index => $column) {
                    if (!$content["tca"][$index]["inlineParent"]) {
                        $contentColumns[] = $column;
                    } else {
                        unset($value[$index]);
                        unset($value[$index]);
                    }
                    if ($key === 'labels'
                        && empty($column)
                        && isset($json[$content['type']]['tca'][$content['elements']['columns'][$index]])
                    ) {
                        // If using a mask field with empty label, we have to set the "default" label
                        $label = '';
                        foreach ($json[$content['type']]['elements'] as $element) {
                            if (in_array($content['elements']['columns'][$index], $element['columns'], true)) {
                                $i = array_search($content['elements']['columns'][$index], $element['columns'], true);
                                if (!empty($element['labels'][$i])) {
                                    $label = $element['labels'][$i];
                                    break;
                                }
                            }
                        }
                        $value[$index] = $label;
                    }
                }
            }
            $json[$content["type"]]["elements"][$content["elements"]["key"]][$key] = $value;
        }

        $contentColumns = array();
        $columns = array();

        // delete columns and labels of irre-fields from elements
        if ($content["elements"]["columns"]) {
            foreach ($content["elements"]["columns"] as $index => $column) {
                if (!$content["tca"][$index]["inlineParent"]) {
                    $contentColumns[] = $column;
                } else {
                    unset($content["elements"]["columns"][$index]);
                    unset($content["elements"]["labels"][$index]);
                }
                $columns[] = $column;
            }
        }

        // Create JSON sql Array:
        if (is_array($content["sql"])) {
            foreach ($content["sql"] as $table => $sqlArray) {
                foreach ($sqlArray as $index => $type) {
                    $fieldname = "tx_mask_" . $columns[$index];
                    $json[$table]["sql"][$fieldname][$table][$fieldname] = $type;
                }
            }
        }

        // Create JSON tca Array:
        if (is_array($content["tca"])) {


            foreach ($content["tca"] as $key => $value) {
                $inlineField = false;

                // if this field is inline-field
                if ($value["inlineParent"]) {
                    $type = $value["inlineParent"];
                    $inlineField = true;
                } else {
                    $type = $content["type"];
                }

                $json[$type]["tca"][$columns[$key]] = $value;

                // add rte flag if inline and rte
                if ($inlineField) {
                    if ($content["elements"]["options"][$key] == "rte") {
                        $json[$type]["tca"][$columns[$key]]["rte"] = "1";
                    }
                }

                // Only add columns to elements if it is no inlinefield
                if (!$inlineField) {
                    $json[$type]["elements"][$content["elements"]["key"]]["columns"][$key] = "tx_mask_" . $columns[$key];
                }
                $json[$type]["tca"]["tx_mask_" . $columns[$key]] = $json[$type]["tca"][$columns[$key]];
                $json[$type]["tca"]["tx_mask_" . $columns[$key]]["key"] = $columns[$key];

                if ($inlineField) {
                    $json[$type]["tca"]["tx_mask_" . $columns[$key]]["order"] = $key;
                }

                unset($json[$type]["tca"][$columns[$key]]);
            }
        }

        // sort content elements by key before saving
        $this->sortJson($json);
        $this->write($json);
    }