1 | <?php namespace Arcanedev\EmbedVideo\Entities; |
||
12 | class Iframe implements Htmlable |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Properties |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $pattern; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $queries; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $replacer; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $attributes; |
||
37 | |||
38 | /* ----------------------------------------------------------------- |
||
39 | | Constructor |
||
40 | | ----------------------------------------------------------------- |
||
41 | */ |
||
42 | /** |
||
43 | * Iframe constructor. |
||
44 | * |
||
45 | * @param string $pattern |
||
46 | * @param array $replacer |
||
47 | * @param array $queries |
||
48 | * @param array $attributes |
||
49 | */ |
||
50 | 30 | public function __construct($pattern, array $replacer = [], array $queries = [], array $attributes = []) |
|
57 | |||
58 | /* ----------------------------------------------------------------- |
||
59 | | Getters & Setters |
||
60 | | ----------------------------------------------------------------- |
||
61 | */ |
||
62 | /** |
||
63 | * Get iframe src value. |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | 30 | public function src() |
|
71 | |||
72 | /* ----------------------------------------------------------------- |
||
73 | | Main Methods |
||
74 | | ----------------------------------------------------------------- |
||
75 | */ |
||
76 | /** |
||
77 | * Render the iframe. |
||
78 | * |
||
79 | * @return \Illuminate\Support\HtmlString |
||
80 | */ |
||
81 | 30 | public function render() |
|
87 | |||
88 | /** |
||
89 | * Get content as a string of HTML. |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | 9 | public function toHtml() |
|
97 | |||
98 | /** |
||
99 | * Convert the object to string. |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | public function __toString() |
||
107 | |||
108 | /* ----------------------------------------------------------------- |
||
109 | | Other Methods |
||
110 | | ----------------------------------------------------------------- |
||
111 | */ |
||
112 | /** |
||
113 | * Render the base URL. |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | 30 | protected function renderUrl() |
|
125 | |||
126 | /** |
||
127 | * Render the URL queries. |
||
128 | * |
||
129 | * @return string |
||
130 | */ |
||
131 | 30 | protected function renderQueries() |
|
151 | |||
152 | /** |
||
153 | * Render the attributes. |
||
154 | * |
||
155 | * @return string |
||
156 | */ |
||
157 | 30 | protected function renderAttributes() |
|
167 | } |
||
168 |