/** * este metodo se encarga de pintar el html de la vista por defcto para inmueble, que es el listado. */ public function index() { if (Session::get("auth")) { header('Location: ' . URL . 'news/'); } else { //MUETRA LOS ERRORES, EN EL MEtODO INDEX ESTA EL BLOQUE errors_row $this->initializeTpl("pagina", "Login"); $this->_tpl->assign('header_login', Idioma::get("header_login")); if (Session::get('errors')) { $arr_temp = Session::getAndDestroy('errors'); foreach ($arr_temp as $value) { $this->_tpl->newBlock('errors_row'); $this->_tpl->assign("salida", $value); } } $this->_tpl->printToScreen(); } }
/** funcion privada para inicializar el objeto tpl de la clase. Se le pasal el titulo y demas * * @param string $str * @param string $titulo titlo del documetno */ private function initializeTpl($str, $titulo) { $this->_tpl->assignInclude('content', $GLOBALS['tpl_theme_views'] . $GLOBALS['controlador'] . '-' . $GLOBALS['metodo'] . '.html'); if (Session::get('errors')) { $this->_tpl->assignInclude('errors', $GLOBALS['tpl_theme_views'] . $GLOBALS['controlador'] . '-errors.html'); } $this->_tpl->prepare(); $this->_tpl->assign('content', ''); $this->_tpl->gotoBlock('_ROOT'); $this->_tpl->assign('title', TITULO . ' - ' . $titulo); $this->_tpl->assign('theme_url', $GLOBALS['tpl_theme_url']); $this->_tpl->assignGlobal('page_url', $GLOBALS['tpl_host']); $this->_tpl->assignGlobal('guardar', Idioma::get("guardar")); }