/** * @return Ajde_Layout */ public function setLayout(Layout $layout) { if (!$layout instanceof Layout) { $layout = new Layout($layout); } $layout->setDocument($this); return $this->set("layout", $layout); }
public static function getLinkTemplateFilename($type, $format = 'null') { if (Ajde::app()->getDocument()->hasLayout()) { $layout = Ajde::app()->getDocument()->getLayout(); } else { $layout = new Layout(Config::get("layout")); } $format = issetor($format, 'html'); $dirPrefixPatterns = array(APP_DIR, CORE_DIR); foreach ($dirPrefixPatterns as $dirPrefixPattern) { $prefixedLayout = $dirPrefixPattern . LAYOUT_DIR; if (self::exist($prefixedLayout . $layout->getName() . '/link/' . $type . '.' . $format . '.php')) { return $prefixedLayout . $layout->getName() . '/link/' . $type . '.' . $format . '.php'; } } return false; }