public static function fetchTemplate($tpl = null) { $xajax = Sokol::getApp()->xajax; $xajax->processRequest(); DOC::addHeader($xajax->getJavascript()); $smarty = self::getInstance(); $smarty->assignGlobal('headers', DOC::getHeaders()); if (Sokol::getApp()->name == 'Admin') { $smarty->assignGlobal('html', new \Sokol\Admin\HTML()); } $smarty->assignGlobal('app', Sokol::getApp()); return $smarty->fetch($tpl); }
public function getRootEntities() { $path_entities = Sokol::getApp()->getPath() . '/Entity'; if (is_dir($path_entities)) { $mask = $path_entities . '/*.php'; $entitiesPathes = glob($mask); foreach ($entitiesPathes as $k => $row) { $entitiesPathes[$k] = '\\' . Sokol::getApp()->name . '\\Entity\\' . basename($row, '.php'); } echo '<pre>'; var_dump($entitiesPathes); return $entitiesPathes; } else { return array(); } }