public function output(\Pagemill_Data $data, \Pagemill_Stream $stream) { $this->name = 'html'; $pm = new Pagemill($data); $skin = $data->parseVariables($this->getAttribute('skin')); $oldskin = null; if ($skin) { $oldskin = Typeframe_Skin::Current(); Typeframe_Skin::Set($skin); } else { $skin = Typeframe_Skin::Current(); } if (file_exists(TYPEF_DIR . '/skins/' . $skin . '/skin.html')) { $skinTree = $pm->parseFile(TYPEF_DIR . '/skins/' . $skin . '/skin.html'); } else { $skinTree = $pm->parseFile(TYPEF_DIR . '/skins/default/skin.html'); } $skinTree->process($data, $stream); if (!is_null($oldskin)) { Typeframe_Skin::Set($oldskin); } }
public function output(Pagemill_Data $data, Pagemill_Stream $stream) { $file = $data->parseVariables($this->getAttribute('file')); if (!isset(self::$_includeCache[$file])) { $pm = new Pagemill($data); $tree = $pm->parseFile($file, $this->doctype()); self::$_includeCache[$file] = $tree; } else { $tree = self::$_includeCache[$file]; } // Unlike most tags, we don't want to use append/detach here // because the tree might be a fragment. //$this->appendChild($tree); $tree->parent = $this->parent; $tree->process($data, $stream); //$tree->detach(); $tree->parent = null; }