Properties

$finder

$finder :

Type

$originalMatch

$originalMatch :

Type

$tag

$tag :

Type

$attributes

$attributes :

Type

$dataUrlAttributes

$dataUrlAttributes :array<mixed,string>

Attributes, which are represented as data URL.

Type

array<mixed,string>

$changed

$changed :

Type

$beforeTag

$beforeTag :

Type

$afterTag

$afterTag :

Type

$doOmit

$doOmit :

Type

$beforeLinkAttribute

$beforeLinkAttribute :

Type

$afterLink

$afterLink :

Type

$linkAttribute

$linkAttribute :

Type

Methods

__construct()

__construct(\DevOwl\FastHtmlTag\finder\TagAttributeFinder  $finder,string  $originalMatch,string  $tag,array  $attributes,string  $beforeLinkAttribute,string  $afterLink,string  $linkAttribute)

C'tor.

Parameters

\DevOwl\FastHtmlTag\finder\TagAttributeFinder $finder
string $originalMatch
string $tag
array $attributes
string $beforeLinkAttribute
string $afterLink
string $linkAttribute

render()

render(): string

Render this match to valid HTML. Please pass your result to `encloseRendered` and return that result.

Returns

string

omit()

omit()

Omit the rendering.

isOmitted()

isOmitted()

Should we omit the rendering for this node?

isAttributeDataUrl()

isAttributeDataUrl(string  $key)

Check if a given attribute is a data URL and return the mime type.

Parameters

string $key

isSelfClosing()

isSelfClosing()

Check if the original match is a self-closing HTML tag. E.g. `<link />` vs. `<link></link>`.

getAttribute()

getAttribute(string  $key,mixed  $default = null)

Get attribute by key.

Parameters

string $key
mixed $default

hasAttribute()

hasAttribute(string  $key)

Check if the match has a given attribute.

Parameters

string $key

calculateUniqueKey()

calculateUniqueKey(array<mixed,string>  $idKeys = array('id'),array<mixed,string[]>  $looseAttributes = array()): string|null

Calculate a unique key for this match.

Parameters

array<mixed,string> $idKeys

Consider ID keys as unique (ordered by priority)

array<mixed,string[]> $looseAttributes

Returns

string|null —

Can return null if we cannot calculate a unique key for this container

setAttribute()

setAttribute(string  $key,mixed|null  $value,null|false|string  $dataUrlTransformation = null)

Set attribute by key and value.

Parameters

string $key
mixed|null $value
null|false|string $dataUrlTransformation

Pass a mime type so it gets transformed to base64-encoded attribute value

setAttributes()

setAttributes(array  $attributes)

Setter.

Parameters

array $attributes

setTag()

setTag(string  $string)

Setter. Use this with caution! Due to the fact, this can break your HTML code, if the finder does not hold the end tag!

Parameters

string $string

setBeforeTag()

setBeforeTag(string  $string)

Setter.

Attention: If setting this, make sure, your match does no longer match again so you do not end up in an endless loop.

Parameters

string $string

setAfterTag()

setAfterTag(string  $string)

Setter.

Attention: If setting this, make sure, your match does no longer match again so you do not end up in an endless loop.

Parameters

string $string

setChanged()

setChanged(boolean  $status)

Indicate that the match has a change. You need to mark this to `true` to apply changes to your HTML.

Parameters

boolean $status

getOriginalMatch()

getOriginalMatch()

Getter.

getTag()

getTag()

Getter.

getAttributes()

getAttributes()

Getter.

hasChanged()

hasChanged()

Getter.

getBeforeTag()

getBeforeTag()

Getter.

getAfterTag()

getAfterTag()

Getter.

getBeforeLinkAttribute()

getBeforeLinkAttribute()

Getter.

getAfterLink()

getAfterLink()

Getter.

getLinkAttribute()

getLinkAttribute()

Getter.

getLink()

getLink()

Getter.

transformBase64DataUrls()

transformBase64DataUrls()

Automatically transform base64-encoded data URLs and memorize in `$this->dataUrlAttributes` for rendering process.

renderAttributes()

renderAttributes()

Render attributes to a single string so it can be e.g. used with `<div %s`.

encloseRendered()

encloseRendered(string  $html)

Use `beforeTag` and `afterTag`.

Parameters

string $html