Iframe
API reference › HTML › Embedded › Iframe
Renders the HTML <iframe> element for embedding a nested browsing context.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe (BaseBlock for the base implementation.).
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$attributes protected | mixed[] | HTML attributes array used by the implementing class. Default: []. | UIAwesome\ |
$content protected | string | Content string assigned to the element. Default: ''. | UIAwesome\ |
Methods
Section titled “Methods”Method details
Section titled “Method details”allow()
Section titled “allow() ”public function allow(string|Stringable|UnitEnum|null $value): staticSets the allow attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Permissions Policy applied to the embedded content, or null to remove the attribute. |
Returns
static: New instance with the updated allow attribute.
allowfullscreen()
Section titled “allowfullscreen() ”public function allowfullscreen(bool $value): staticSets the allowfullscreen attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | bool | Whether the embedded content can activate fullscreen mode. |
Returns
static: New instance with the updated allowfullscreen attribute.
height()
Section titled “height() ”public function height(int|string|Stringable|UnitEnum|null $value): staticSets the height attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | int|Stringable|UnitEnum| | Height value in pixels or CSS units, or null to remove the attribute. |
Returns
static: New instance with the updated height attribute.
loading()
Section titled “loading() ”public function loading(string|Stringable|UnitEnum|null $value): staticSets the loading attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Loading strategy (‘eager’ or ‘lazy’), or null to remove the attribute. |
Returns
static: New instance with the updated loading attribute. Loading for predefined enum values.
Throws
InvalidArgumentException: if the value is not valid.
name()
Section titled “name() ”public function name(string|Stringable|UnitEnum|null $value): staticSets the name attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Targetable name for the embedded browsing context, or null to remove the attribute. |
Returns
static: New instance with the updated name attribute.
referrerpolicy()
Section titled “referrerpolicy() ”public function referrerpolicy(string|Stringable|UnitEnum|null $value): staticSets the referrerpolicy attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Referrer policy token, or null to remove the attribute. |
Returns
static: New instance with the updated referrerpolicy attribute. Referrerpolicy for predefined enum values.
Throws
InvalidArgumentException: if the value is not valid.
sandbox()
Section titled “sandbox() ”public function sandbox(string|Stringable|UnitEnum|null $value): staticSets the sandbox attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Space-separated restriction tokens, an empty string to apply all restrictions, or null to remove the attribute. |
Returns
static: New instance with the updated sandbox attribute.
src()
Section titled “src() ”public function src(string|Stringable|UnitEnum|null $value): staticSets the src attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | URL of the page to embed, or null to remove the attribute. |
Returns
static: New instance with the updated src attribute.
srcdoc()
Section titled “srcdoc() ”public function srcdoc(string|Stringable|UnitEnum|null $value): staticSets the srcdoc attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Inline HTML to embed in place of the src attribute, or null to remove the attribute. |
Returns
static: New instance with the updated srcdoc attribute.
width()
Section titled “width() ”public function width(int|string|Stringable|UnitEnum|null $value): staticSets the width attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | int|Stringable|UnitEnum| | Width value in pixels or CSS units, or null to remove the attribute. |
Returns
static: New instance with the updated width attribute.
getTag()
Section titled “getTag() ”protected function getTag(): UIAwesome\Html\Interop\BlockReturns the tag enumeration for the <iframe> element.