public function view($path = '', $trim = true, $return = true)
    {
        if (!empty($path)) {

            $results = $this->query($path);

            // create an empty template object for xpath query results.
            $template = new FabricationEngine();
            foreach ($results as $result) {
                $node = $template->importNode($result, true);
                $template->appendChild($node);
            }

            if ($trim) {
                $buffer = trim($template->saveHTML());
            } else {
                $buffer = $template->saveHTML();
            }
        } else {

            if ($trim) {
                $buffer = trim($this->saveHTML());
            } else {
                $buffer = $this->saveHTML();
            }
        }

        if ($return) {
            return $buffer;
        }

        echo $buffer;
    }
public function view($path = '', $trim = true, $return = true)
    {
        if (!empty($path)) {

            $results = $this->query($path);

            // create an empty template object for xpath query results.
            $template = new FabricationEngine();
            foreach ($results as $result) {
                $node = $template->importNode($result, true);
                $template->appendChild($node);
            }

            if ($trim) {
                $buffer = trim($template->saveHTML());
            } else {
                $buffer = $template->saveHTML();
            }
        } else {

            if ($trim) {
                $buffer = trim($this->saveHTML());
            } else {
                $buffer = $this->saveHTML();
            }
        }

        if ($return) {
            return $buffer;
        }

        echo $buffer;
    }
public function view ( $ path = '' , $ trim = true , $ return = true ) { if ( ! empty ( $ path ) ) { $ results = $ this -> query ( $ path ) ; // create an empty template object for xpath query results.
 $ template = new FabricationEngine ( ) ; foreach ( $ results as $ result ) { $ node = $ template -> importNode ( $ result , true ) ; $ template -> appendChild ( $ node ) ; } if ( $ trim ) { $ buffer = trim ( $ template -> saveHTML ( ) ) ; } else { $ buffer = $ template -> saveHTML ( ) ; } } else { if ( $ trim ) { $ buffer = trim ( $ this -> saveHTML ( ) ) ; } else { $ buffer = $ this -> saveHTML ( ) ; } } if ( $ return ) { return $ buffer ; } echo $ buffer ; }
View the DOMTree in HTML either in full or search using XPath for the
first argument, also trim, return and change the output type, html, xml.

@param string  $path   The xpath to the element to view.
@param boolean $trim   Trim the returned output string.
@param boolean $return Return or Print the output string.

@return	string
View the DOMTree in HTML either in full or search using XPath for the first argument also trim return and change the output type html xml .