Sets the format to html and optionally the content.

@param string $content
@return $this
961807
public function html($content = '')
    {
        $this->format = 'html';

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

        return $this;
    }
560629
protected function detectFormatByContent($content)
    {
        if (preg_match('/^(\\{|\\[\\{).*(\\}|\\}\\])$/is', $content)) {
            return Client::FORMAT_JSON;
        }
        if (preg_match('/^([^=&])+=[^=&]+(&[^=&]+=[^=&]+)*$/', $content)) {
            return Client::FORMAT_URLENCODED;
        }
        if (preg_match('/^<\?xml.*>$/s', $content)) {
            return Client::FORMAT_XML;
        }
        return null;
    }
959308
public function setInnerHtml($content)
    {
        $content = self::create($content);
        foreach ($this as $node) {
            $node->nodeValue = '';
            foreach ($content as $newnode) {
                /** @var \DOMNode $node */
                /** @var \DOMNode $newnode */
                $newnode = static::importNewnode($newnode, $node);
                $node->appendChild($newnode);
            }
        }
        return $this;
    }
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;
    }
1021508
public function setContent($content)
    {
        if (is_array($content) || $content instanceof ArrayAccess || $content instanceof JsonSerializable) {
            $this->headers->add(['Content-Type' => 'application/json; charset=utf-8']);
            $content = json_encode($content, JSON_UNESCAPED_UNICODE);
        }

        parent::setContent($content);
        parent::setCharset('utf-8');

        return $this;
    }
733729
public function before($content)
    {
        $content = self::create($content);
        $newnodes = array();
        foreach ($this as $i => $node) {
            /** @var \DOMNode $node */
            foreach ($content as $newnode) {
                /** @var \DOMNode $newnode */
                if ($node !== $newnode) {
                    $newnode = static::importNewnode($newnode, $node, $i);
                    $node->parentNode->insertBefore($newnode, $node);
                    $newnodes[] = $newnode;
                }
            }
        }
        $content->clear();
        $content->add($newnodes);
        return $this;
    }
1187330
public function setText($content, $charset = 'utf-8') {
        $this->text = $content;
        $this->textCharset = $charset;
        return $this;
    }
849742
public function html($content) {
        if (func_num_args() == 1) {
            $this->_data['fields'][] = $content;
            return $this;
        }
        $this->__attributes['fields'][$content] = func_get_arg(1);
        return $this;
    }
1163507
function setBody($content)
    {
        if (! $content instanceof iStreamable )
            ## Instead Of StreamInterface must convert to string
            $content = (string) $content;

        $this->body = $content;
        return $this;
    }
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);
        }
    }
1166837
public function set($content)
    {
        if (is_string($content))
            $content = explode(',', $content);

        if ( ! is_array($content))
            $content = (array) $content;

        $this->content = array_map(function ($keyword) {
            return $this->clean($keyword);
        }, $content);

        return $this;
    }
677224
public function setContent($content)
    {
        if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable(array($content, '__toString'))) {
            throw new \UnexpectedValueException(sprintf('The Response content must be a string or object implementing __toString(), "%s" given.', gettype($content)));
        }

        $this->content = (string) $content;

        return $this;
    }
705778
protected function appendLine( string$content ):self
	{
		false===$this->indentation or $content= str_repeat($this->indentation,$this->level-$this->sectionLevel).$content."\n";

		return $this->append($content);
	}
752836
public function setHTML($content, array $options = array()) {
        $this->html = $content;
        $this->htmlCharset = (isset($options['charset'])) ? $options['charset'] : 'utf-8';
        if (@$options['autoSetText']) {
            $this->setText(strip_tags($this->html), $this->htmlCharset);
        }
        return $this;
    }
487102
private function setContent($content)
    {
        if (strpos($content, 'file://') === 0) {
            $content = $this->readFile($content);
        }

        $this->content = $content;
    }
1249396
protected function formatContent($content)
    {
        if ($this->request->method == 'HEAD') {
            return (object) $this->headers;
        }

        if ($this->isXml()) {
            return json_decode($this->parseXml($content));
        }

        if ($this->isJson()) {
            return json_decode($content);
        }
    }
13221
public function setFormat($value = null)
    {
        if ($value != null) {
            $this->_params['format'] = $value;
        } else {
            unset($this->_params['format']);
        }
        return $this;
    }