Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Support;
4
 
5
use Illuminate\Contracts\Support\Htmlable;
6
 
7
class HtmlString implements Htmlable
8
{
9
    /**
10
     * The HTML string.
11
     *
12
     * @var string
13
     */
14
    protected $html;
15
 
16
    /**
17
     * Create a new HTML string instance.
18
     *
19
     * @param  string  $html
20
     * @return void
21
     */
22
    public function __construct($html = '')
23
    {
24
        $this->html = $html;
25
    }
26
 
27
    /**
28
     * Get the HTML string.
29
     *
30
     * @return string
31
     */
32
    public function toHtml()
33
    {
34
        return $this->html;
35
    }
36
 
37
    /**
38
     * Determine if the given HTML string is empty.
39
     *
40
     * @return bool
41
     */
42
    public function isEmpty()
43
    {
44
        return $this->html === '';
45
    }
46
 
47
    /**
48
     * Determine if the given HTML string is not empty.
49
     *
50
     * @return bool
51
     */
52
    public function isNotEmpty()
53
    {
54
        return ! $this->isEmpty();
55
    }
56
 
57
    /**
58
     * Get the HTML string.
59
     *
60
     * @return string
61
     */
62
    public function __toString()
63
    {
64
        return $this->toHtml();
65
    }
66
}