Append content to response.

@param string $content
@param int $code

@return $this
427848
public function appendContent($content, $code = 200)
    {
        if (!empty($content)) {
            $oldContent = $this->getContent();

            if (!empty($oldContent)) {
                if (!is_scalar($content)) {
                    $content = json_encode($content);
                }

                $this->toHTML();
                $content = $oldContent . $content;
            }

            $this->setContent($content, $code);
        }
        return $this;
    }
970019
public function response($content, $code)
    {
        $this->setJsonHeader();

        $this->setStatusCode($code);

        return $this->content($this->serializer->serialize($content));
    }
1347009
public function send($content)
    {
        if (is_string($content)) {
            $this->clear();
            $this->response->getBody()->write($content);
        } else if ($content instanceof StreamInterface) {
            $this->response = $this->response->withBody($content);
        }

        return $this;
    }
42727
public function setContent($content)
    {
        $this->content = null;
        if ($content === null) {
            return;
        }

        if (TypeHandling::isSimpleType(gettype($content)) && !is_array($content)) {
            $this->content = (string)$content;
        }

        if (is_resource($content)) {
            $this->content = $content;
        }

        return $this;
    }
111773
protected function createPlainResponse($content, $code = 200)
    {
        return $this->getComponentResponseFactory()
            ->createComponentResponse()
            ->setCode($code)
            ->setContent($content);
    }
1037061
public function setContent($content = null)
    {
        if (null !== $content && !is_string($content)) {
            throw new ResponseException('Response content must be a string.');
        }

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

        return $this;
    }
195699
public function setContent($content)
    {
        $context = $this->_context;

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

        return $this;
    }
963431
public static function append(string $filename, string $content): int
    {
        return file_put_contents($filename, $content, FILE_APPEND);
    }
734671
public function create($content, $code = 200, $headers = [], $charset = null)
    {
        return $this->serializer->serialize(
            new Response($content, $code, $headers, $charset),
            'json'
        );
    }
754726
public function setHttpCode(int $code): Response
    {
        if ($this->response_finished) {
            return $this;

        }

        $this->response_code = $code;

        return $this;
    }
207155
public function addContent($content)
    {
        if (!$this->inQuotes && $this->wasQuoted) {
            throw new RuntimeException(
                "Invalid CSV: Attempting to add a string to a field that was in quotes: " . $this->content . $content
            );
        }
        $this->content .= $content;
        $this->isNull = false;
        $this->hasContent = true;
        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);
	}
697344
public function addContent(\Coral\ContentBundle\Entity\Content $contents)
    {
        $this->contents[] = $contents;

        return $this;
    }
1129099
public function append($content)
    {
        $content = self::create($content);
        $newnodes = array();
        foreach ($this as $i => $node) {
            /** @var \DOMNode $node */
            foreach ($content as $newnode) {
                /** @var \DOMNode $newnode */
                $newnode = static::importNewnode($newnode, $node, $i);
                $node->appendChild($newnode);
                $newnodes[] = $newnode;
            }
        }
        $content->clear();
        $content->add($newnodes);
        return $this;
    }
142934
public function appendTextContent(string $content) : Tag
    {
        if ($this->isVoid) {
            throw new \LogicException('Void elements cannot have any contents.');
        }

        $this->content .= htmlspecialchars($content, ENT_NOQUOTES | ENT_HTML5);

        return $this;
    }
47055
public function appendText($value)
    {
        $text = $this->stringify($value);
        $this->message = $this->message . $text;

        return $this;
    }
74358
public function prependContent($content)
    {
        if (!empty($content)) {
            if (is_array($this->content)) {
                array_unshift($this->content, $content);
            } else {
                $this->content = $content . $this->content;
            }
        }
        return $this;
    }