function format_date($f, $t = 0, $h = FALSE) { if (!is_numeric($t)) { $t = 0; } $i = Controller::get_instance(); if (!class_exists('go2hi')) { $i->load->library('go2hi'); } return $i->go2hi->date($f, $h === FALSE ? GO2HI_GREG : GO2HI_HIJRI, $t, 1); }
function template($path, $hData = array()) { global $sEngineDebug, $sControllerDebug; $sTemplatePath = 'app/templates/' . $path; if (!file_exists($sTemplatePath)) { throw new Exception('template ' . $path . ' not found'); } $oController = Controller::get_instance(); if ($oController) { extract($oController->get()); } if (is_array($hData) && sizeof($hData)) { extract($hData); } include $sTemplatePath; }
function &get_instance() { return Controller::get_instance(); }
/** * 加载到超级对象 * @E-mail rushui@qq.com * @author Rushui */ public function set_obj($name, $obj_name) { $name = strtolower($name); //转小写 if (empty($name) || !is_object($obj_name)) { return false; } if (class_exists('Controller')) { $obj = Controller::get_instance(); $obj->{$name} = $obj_name; } else { Yiee::$objs[$name] = $obj_name; } }