v.0.1
This commit is contained in:
56
vendor/illuminate/support/HtmlString.php
vendored
Normal file
56
vendor/illuminate/support/HtmlString.php
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
<?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 === '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTML string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->toHtml();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user