Dom


The dom library is a tool for traversing an HTML document from the server-side. While this should most often be done on the client-side, there are instances (such as scraping content) when a server-side dom tool is useful.

Properties

No public properties available.


fetch()

Get an object representing the HTML DOM. You can use a url or a relative path to your /app/view to parse a view file. A simple_html_dom object is returned. Documentation on using this object can be found here.

$this->zajlib->dom->fetch('http://example.com/page.html');

@param string $file Retrieves the DOM from a file. File can be a view path or a url.
@param boolean $convert_to_lowercase If set to true (the default), it converts the tags and attributes to lowercase.
@return simple_html_dom The simple_html_dom object. See docs for more info.

dump()

Fetches the DOM and displays its hierarchy on screen starting at a node.

$this->zajlib->dom->dump($node, true, 0);

@param DomNode $node Dump the HTML DOM tree starting from the specified node.
@param boolean $show_attr If set to true (the default), it will also display attributes of the dom.
@param integer $depth The depth to start at (this is only for display).

Outlast Web & Mobile Development (c) 2023 | Privacy Policy |