Пример #1
0
 /**
  * Returns the HTML document.
  *
  * @param  array   $data     - The data to render
  * @param  boolean $beatiful - To pretty print or not
  * @param  string  $doctype  - The doctype of this html
  * @return string
  */
 public function render($data = null, $beatiful = false, $doctype = '')
 {
     foreach ($this->aliasFor as $selector => $alias) {
         $this[$selector] = $this[$alias];
     }
     $data = $data ?: $this->getArrayCopy();
     return $this->document->decorate($data)->render($beatiful, $doctype);
 }
Пример #2
0
 /**
  * @return array
  */
 public function getResult()
 {
     // Get results by a CSS selector
     $selector = $this->selector;
     $document = $this->document->getQueryDocument();
     $results = $document->execute($selector);
     $xpath = $results->getXpathQuery();
     $domxpath = new DOMXPath($this->document->getDom());
     $nodelist = iterator_to_array($domxpath->query($xpath));
     return $nodelist;
 }
Пример #3
0
 public function render($data = null, $beatiful = false)
 {
     $this->resolveAliases();
     $data = $data ?: $this->getArrayCopy();
     return $this->document->decorate($data)->render($beatiful);
 }