123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- namespace Illuminate\Support;
- use Illuminate\Contracts\Support\Htmlable;
- class HtmlString implements Htmlable
- {
- /**
- * The HTML string.
- *
- * @var string
- */
- protected $html;
- /**
- * Create a new HTML string instance.
- *
- * @param string $html
- * @return void
- */
- public function __construct($html = '')
- {
- $this->html = $html;
- }
- /**
- * Get the HTML string.
- *
- * @return string
- */
- public function toHtml()
- {
- return $this->html;
- }
- /**
- * Determine if the given HTML string is empty.
- *
- * @return bool
- */
- public function isEmpty()
- {
- return $this->html === '';
- }
- /**
- * Determine if the given HTML string is not empty.
- *
- * @return bool
- */
- public function isNotEmpty()
- {
- return ! $this->isEmpty();
- }
- /**
- * Get the HTML string.
- *
- * @return string
- */
- public function __toString()
- {
- return $this->toHtml();
- }
- }
|