Ejemplo n.º 1
0
 /**
  * @param	mixed	$file 
  * @param	DbMapInterface $map
  * @param	PathFinderInterface	$pathFinder
  * @return	FileViewTemplate
  */
 public function __construct($file, DbMapInterface $dbMap = null)
 {
     if (null !== $dbMap) {
         $this->setDbMap($dbMap);
     }
     parent::__construct($file);
 }
Ejemplo n.º 2
0
 /**
  * @return	string
  */
 public function build()
 {
     $html = $this->getHtmlTag();
     $head = $html->getHead();
     $body = $html->getBody();
     $data = array('html-attrs' => $html->getAttributeString(), 'head-attrs' => $head->getAttributeString(), 'head-title' => $head->getTitle(), 'body-attrs' => $body->getAttributeString());
     if ($head->isBase()) {
         $data['head-base'] = $head->getBase();
     }
     if ($head->isMeta()) {
         $data['head-meta'] = $head->getMeta();
     }
     if ($this->isCss()) {
         /* the inline style tag is the last css tag in the head */
         $head->addCssTag($this->getInlineStyleTag());
         $data['head-css'] = $head->getCssTags();
     }
     $data['body-markup'] = $this->buildView($body);
     if ($this->isJs()) {
         /* make sure the inline script tag is the last tag */
         $this->addScriptTag($this->getInlineScriptTag());
         $data['body-js'] = $this->getScriptTags();
     }
     /*
      * All assignments in the html page are actually for the view content
      * template. We need to clear those out since the view has them by now,
      * and replace them with the data needed for the html doc
      */
     $this->setAssignments($data);
     return parent::build();
 }