HtmlHelper
in package
FinalYes
HTML Utility.
Table of Contents
Methods
- appendHeadBaseTag() : string
- Add <base /> tag to HTML content.
- getBodyNode() : DOMElement
- Get body node.
- getContentCharset() : string
- Get character encoding from HTML
- getContentForIframe() : mixed|null
- Get content for a given URL.
- getDomDocument() : void
- Get dom document.
- getHeadNode() : DOMElement
- Get head node.
- getTitle() : string|null
- Get page title from HTML.
- removeHtmlComment() : string
- Remove HTML comments.
Methods
appendHeadBaseTag()
Add <base /> tag to HTML content.
public
static appendHeadBaseTag(string $content, string $url) : string
Parameters
- $content : string
-
HTML Content.
- $url : string
-
URL of the
tag.
Return values
string —HTML.
getBodyNode()
Get body node.
public
static getBodyNode(DOMDocument &$dom) : DOMElement
Parameters
- $dom : DOMDocument
-
DOMDocument instance.
Return values
DOMElement —body node.
getContentCharset()
Get character encoding from HTML
public
static getContentCharset(string $content) : string
Parameters
- $content : string
-
HTML Content.
Return values
string —Character code.
getContentForIframe()
Get content for a given URL.
public
static getContentForIframe(string $url) : mixed|null
Parameters
- $url : string
-
The URL of the page.
Return values
mixed|null —Acquisition Result.
getDomDocument()
Get dom document.
public
static getDomDocument(string $url, DOMDocument &$dom) : void
Parameters
- $url : string
-
HTML page URL.
- $dom : DOMDocument
-
DOMDocument instance.
getHeadNode()
Get head node.
public
static getHeadNode(DOMDocument &$dom) : DOMElement
Parameters
- $dom : DOMDocument
-
DOMDocument instance.
Return values
DOMElement —head node.
getTitle()
Get page title from HTML.
public
static getTitle(DOMDocument &$dom) : string|null
Parameters
- $dom : DOMDocument
-
DOMDocument instance.
Return values
string|null —Page Title.
removeHtmlComment()
Remove HTML comments.
public
static removeHtmlComment(string $content) : string
Parameters
- $content : string
-
HTML Content.
Return values
string —HTML.