# depicter/trunk/app/src/Document/Models/Elements/Text.php

Depicter — Popup &amp; Slider Builder, version trunk. 34 lines.

- Page: https://pluginprobe.com/plugins/depicter/trunk/code/app/src/Document/Models/Elements/Text.php
- Raw: https://pluginprobe.com/plugins/depicter/trunk/raw/app/src/Document/Models/Elements/Text.php
- Modified: 2022-08-20T06:49:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/depicter/trunk/code/app/src/Document/Models/Elements/Text.php#L10-L20`.

```php
<?php
namespace Depicter\Document\Models\Elements;

use Averta\Core\Utility\Arr;
use Depicter\Document\Models;
use Depicter\Html\Html;

class Text extends Models\Element
{

	public function render() {
		$tag = $this->options->tag ?? 'p';

		$args = $this->getDefaultAttributes();

		$output =  Html::$tag( $args, $this->getContent() );

		if ( false !== $a = $this->getLinkTag() ) {
			return $a->nest( $output ) . "\n";
		}
		return $output . "\n";
	}

	/**
	 * Retrieves the content of element
	 *
	 * @return string
	 */
	protected function getContent(){
		$content = $this->maybeReplaceDataSheetTags( $this->options->content );
		return str_replace("\n", "<br>", $content);
	}
}

```
