Add To Content

Add retrieved input to the end of already existing content in the
Response object.

@param string $content Content to be added.
@return \Symfony\Component\HttpFoundation\Response
354496
public function addContent(string $content): \Symfony\Component\HttpFoundation\Response
    {
        return $this->setContent($this->getContent() . $content);
    }
1346747
public function appendContent($content)
    {
        if ($this->isVoid) {
            throw new Exception\RuntimeException(
                'Void elements can\'t contain content.'
            );
        }

        $this->content .= $content;

        return $this;
    }
711543
public function addResponseContent(ResponseContent $content, $key = '')
    {
        if (empty($key)) {
            $this->responseContent[] = $content->toArray();
        } else {
            $this->responseContent[$key] = $content->toArray();
        }

        return $this;
    }
740134
public function send($content = null)
    {


        //if not buffer sent
        if (!$this->buffered) {
            return $this->sendBuffer($content);
        }

        $this->sendContent($content);

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

        $this->content .= $content;

        return $this;
    }
1043383
public function setContent($content)
    {
        $this->contents = trim($content);

        $this->parsedContents = null;
        return $this;
    }
86354
public function content($content)
    {
        if ($content instanceof Renderable) {
            $this->content = $content->render();
        } else {
            $this->content = (string) $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;
    }
870022
public function setContent(string $content = null): ResponseContextAbstract
    {
        if (is_null($content)) {
            return $this;
        }

        $this->assertIsValid($content);

        $this->content = $content;

        return $this;
    }
119212
public static function append($section, $content)
	{
		if (isset(static::$sections[$section]))
		{
			static::$sections[$section] .= $content;
		}
		else
		{
			static::$sections[$section] = $content;
		}
	}
1261046
public function setContent($content)
    {
        if (null !== $content && !is_string($content) && !is_numeric($content) &&
            ! is_callable(array($content, '__toString'))) {
            throw new \Exception(sprintf(
                'The Response content must be a string or object implementing __toString(), "%s" given.',
                gettype($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);
    }
1262860
private function setContent($content)
    {
        if (is_array($content))
            $this->content = $content;
        elseif (is_string($content))
            $this->content = trim($content);

        return $this;
    }
1228420
public function text($content = '')
    {
        $this->format = 'text';

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

        return $this;
    }
1224455
public function addOne($name, $content)
    {
        $meta = Meta::make($name, $content);

        if ($meta->isValid() && ! $this->isIgnored($name)) {
            $this->put($meta->key(), $meta);
        }

        return $this;
    }
53190
public function prepend($content)
    {
        // Require that the response be unlocked before changing it
        $this->requireUnlocked();

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

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

		return $this;
	}