getUntilStop()
getUntilStop(string $text) : string
Get text until <!--stop--> or all text.
Parameters
| string | $text | with content |
Returns
string —with text
Utilities when working with text.
wrapElementWithStartEnd(string $text, string $tag, string $start, string $end, \Anax\TextFilter\number $count) : array
Wrap HTML element with with start and end.
| string | $text | with content |
| string | $tag | HTML tag to search for |
| string | $start | wrap start part |
| string | $end | wrap end part |
| \Anax\TextFilter\number | $count | hits to search for |
with text and boolean if more was detected.
wrapElementContentWithStartEnd(string $text, string $tag, string $start, string $end, \Anax\TextFilter\number $count) : array
Wrap content of a HTML element with start and end.
| string | $text | with content |
| string | $tag | HTML tag to search for |
| string | $start | wrap start part |
| string | $end | wrap end part |
| \Anax\TextFilter\number | $count | hits to search for |
with text and boolean if more was detected.
createToc(string $text, integer $start = 2, integer $stop = 4) : array
Create a TOC of HTML headings from and to a certain level.
| string | $text | with content |
| integer | $start | level of headings to use for toc. |
| integer | $stop | level of headings to use for toc. |
with entries to generate a TOC.
createAnchor4Header(string $text, integer $start = 1, integer $stop = 4) : string
Create a anchor for each header having an id.
| string | $text | with content |
| integer | $start | level of headings to use. |
| integer | $stop | level of headings to use. |
with modified text.
addBaseurlToRelativeLinks(string $text, string $baseurl, callable $callback) : string
Add baseurl to all relative links.
| string | $text | with content. |
| string | $baseurl | as string to prepend relative link. |
| callable | $callback | Use to create url from route. |
with modified text.
addBaseurlToImageSource(string $text, string $baseurl, callable $callback) : string
Add baseurl to all relative links in image source.
| string | $text | with content. |
| string | $baseurl | as string to prepend relative link. |
| callable | $callback | Use to create url from route. |
with modified text.
addRevisionHistory(string $text, array $revision, string $start, string $end, string $class, string $source = null) : string
Generate revision history and add to the end of content.
| string | $text | with content. |
| array | $revision | with all revisions. |
| string | $start | start wrap with this. |
| string | $end | end wrap with this. |
| string | $class | to add to ul element. |
| string | $source | optional url to document source. |
with text and optionally added revision history.