class HtmlExtension extends AbstractExtension (View source)

HTML functionality Twig extension.

Methods

__construct(Markdown $markdown, Canonical $canonical)

No description

array
getFunctions()

{@inheritdoc}

array
getFilters()

{@inheritdoc}

canonical(string|null $route = null, array $params = [])

No description

string
markdown(string $content)

Transforms the given Markdown content into HTML content.

string
shy(string $str)

Add 'soft hyphens' ­ to a string, so that it won't break layout in HTML when using strings without spaces or dashes.

void
redirect(string $path)

Simple redirect to given path

string
absoluteLink(string $link)

Use relative_path to create a proper link to either a relative page, or to an external source. In the below example, the editor can provide either page/about, or https://boltcms.io, and both will work

Details

__construct(Markdown $markdown, Canonical $canonical)

Parameters

Markdown $markdown
Canonical $canonical

array getFunctions()

{@inheritdoc}

Return Value

array

array getFilters()

{@inheritdoc}

Return Value

array

canonical(string|null $route = null, array $params = [])

Parameters

string|null $route
array $params

string markdown(string $content)

Transforms the given Markdown content into HTML content.

Parameters

string $content

Return Value

string

string shy(string $str)

Add 'soft hyphens' ­ to a string, so that it won't break layout in HTML when using strings without spaces or dashes.

Parameters

string $str

Return Value

string

void redirect(string $path)

Simple redirect to given path

Parameters

string $path

Return Value

void

Use relative_path to create a proper link to either a relative page, or to an external source. In the below example, the editor can provide either page/about, or https://boltcms.io, and both will work

Parameters

string $link

Return Value

string