Excerpts
in package
Class Excerpts
Table of Contents
Methods
- getExcerptFromHtml() : array<string|int, mixed>|null
- Get an Excerpt array from a chunk of HTML
- getHtmlFromExcerpt() : string
- Rebuild HTML tag from an excerpt array
- processImageExcerpt() : array<string|int, mixed>
- Process an image excerpt
- processImageHtml() : string
- Process Grav image media URL from HTML tag
- processLinkExcerpt() : mixed
- Process a Link excerpt
- processLinkHtml() : string
- Process Grav page link URL from HTML tag
- processMediaActions() : Medium|Link
- Process media actions
Methods
getExcerptFromHtml()
Get an Excerpt array from a chunk of HTML
public
static getExcerptFromHtml(string $html, string $tag) : array<string|int, mixed>|null
Parameters
- $html : string
-
Chunk of HTML
- $tag : string
-
A tag, for example
img
Return values
array<string|int, mixed>|null —returns nested array excerpt
getHtmlFromExcerpt()
Rebuild HTML tag from an excerpt array
public
static getHtmlFromExcerpt(array<string|int, mixed> $excerpt) : string
Parameters
- $excerpt : array<string|int, mixed>
Return values
stringprocessImageExcerpt()
Process an image excerpt
public
static processImageExcerpt(array<string|int, mixed> $excerpt[, PageInterface|null $page = null ]) : array<string|int, mixed>
Parameters
- $excerpt : array<string|int, mixed>
- $page : PageInterface|null = null
-
Page, defaults to the current page object
Return values
array<string|int, mixed>processImageHtml()
Process Grav image media URL from HTML tag
public
static processImageHtml(string $html[, PageInterface|null $page = null ]) : string
Parameters
- $html : string
-
HTML tag e.g.
<img src="image.jpg" /> - $page : PageInterface|null = null
-
Page, defaults to the current page object
Return values
string —Returns final HTML string
processLinkExcerpt()
Process a Link excerpt
public
static processLinkExcerpt(array<string|int, mixed> $excerpt[, PageInterface|null $page = null ][, string $type = 'link' ]) : mixed
Parameters
- $excerpt : array<string|int, mixed>
- $page : PageInterface|null = null
-
Page, defaults to the current page object
- $type : string = 'link'
processLinkHtml()
Process Grav page link URL from HTML tag
public
static processLinkHtml(string $html[, PageInterface|null $page = null ]) : string
Parameters
- $html : string
-
HTML tag e.g.
<a href="../foo">Page Link</a> - $page : PageInterface|null = null
-
Page, defaults to the current page object
Return values
string —Returns final HTML string
processMediaActions()
Process media actions
public
static processMediaActions(Medium $medium, string|array<string|int, mixed> $url[, PageInterface|null $page = null ]) : Medium|Link
Parameters
- $medium : Medium
- $url : string|array<string|int, mixed>
- $page : PageInterface|null = null
-
Page, defaults to the current page object