當前位置: 首頁>>代碼示例>>PHP>>正文


PHP View::setLayout方法代碼示例

本文整理匯總了PHP中View::setLayout方法的典型用法代碼示例。如果您正苦於以下問題:PHP View::setLayout方法的具體用法?PHP View::setLayout怎麽用?PHP View::setLayout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在View的用法示例。


在下文中一共展示了View::setLayout方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testRenderLayout

 public function testRenderLayout()
 {
     $this->view->setLayout('layout');
     $output = $this->view->render('page', true);
     $this->assertContains('Page text', $output);
     $this->assertContains('Layout start', $output);
     $this->assertContains('Layout end', $output);
 }
開發者ID:starweb,項目名稱:starlit-app,代碼行數:8,代碼來源:ViewTest.php

示例2: errorAction

 /**
  * This action will be called by the Request object when an exception has
  * been encountered. 
  * 
  * @return Response
  */
 public function errorAction($request)
 {
     $response = $request->getResponse();
     $viewScript = DEBUG ? 'development' : 'production';
     // get the Exception from the Response
     $exception = $response->getException();
     switch ($exception->getCode()) {
         case Response::NOT_FOUND:
             // 404 error - controller or action not found
             $viewScript = 'pagenotfound';
             break;
         case Response::NOT_ACCEPTABLE:
             // 406 error - content type missing or invalid
             break;
         default:
             // other error code
             break;
     }
     if ('html' === $request->getContentType()) {
         $view = new View();
         $view->setScript($viewScript);
         $view->setLayout('error');
         $response->setView($view);
     }
     return $response;
 }
開發者ID:sayi21cn,項目名稱:apify-library,代碼行數:32,代碼來源:ErrorController.php

示例3: indexAction

 /**
  * indexAction
  *
  * Index action of main controller forum module
  *
  * @return null
  */
 public function indexAction()
 {
     // assign data into view
     \View::assign(array('title' => \View::$language->forum_main_title, 'h1' => \View::$language->forum_main_title, 'forumsTree' => helpers\ForumsTreeHelper::getTree()));
     // set output layout
     \View::setLayout('forum-main.phtml');
 }
開發者ID:nsedenkov,項目名稱:phpsu,代碼行數:14,代碼來源:mainController.php

示例4: save

 public function save()
 {
     $obj = new asistenciaalumno();
     if ($_POST['identificador_editar'] == true) {
         $p = $obj->update($_POST);
         if ($p[0]) {
             die("<script> window.location='index.php?controller=asistenciaalumno'; </script>");
         } else {
             $data = array();
             $view = new View();
             $data['msg'] = $p[1];
             $data['url'] = 'index.php?controller=asistenciaalumno';
             $view->setData($data);
             $view->setTemplate('../view/_Error_App.php');
             $view->setLayout('../template/Layout.php');
             $view->render();
         }
     } else {
         $p = $obj->insert($_POST);
         if ($p[0]) {
             header('Location:index.php?controller=asistenciaalumno');
         } else {
             $data = array();
             $view = new View();
             $data['msg'] = $p[1];
             $data['url'] = 'index.php?controller=asistenciaalumno';
             $view->setData($data);
             $view->setTemplate('../view/_Error_App.php');
             $view->setLayout('../template/Layout.php');
             $view->render();
         }
     }
 }
開發者ID:ewo1991,項目名稱:sisacreditacion,代碼行數:33,代碼來源:asistenciaalumnoController.php

示例5: config

 public function config()
 {
     $view = new View();
     $view->setTemplate('../view/_PanelConfig.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
開發者ID:AnthonyWainer,項目名稱:sisacreditacion,代碼行數:7,代碼來源:BaseDatosController.php

示例6: index

 public function index()
 {
     //        if (!isset($_GET['p'])) {
     //            $_GET['p'] = 1;
     //        }
     //        if (!isset($_GET['q'])) {
     //            $_GET['q'] = "";
     //        }
     //        if (!isset($_GET['criterio'])) {
     //            $_GET['criterio'] = "detalle_asignacion_tutoria.CodigoSemestre";
     //        }
     //         $obj = new asignaciontutoria();
     //        $data = array();
     //        $data['data'] = $obj->index($_GET['q'], $_GET['p'], $_GET['criterio']);
     //        $data['query'] = $_GET['q'];
     //        $data['pag'] = $this->Pagination(array('rows' => $data['data']['rowspag'], 'url' => 'index.php?controller=alumno&action=index', 'query' => $_GET['q']));
     //        $cols = array("CODIGO", "Docente");
     //         $opt = array("" => "------","CodigoSemestre" => "Semestre");
     //
     //         $data['facultades'] = $this->Select(array('id' => 'CodigoFacultad', 'name' => 'CodigoFacultad', 'table' => 'facultades', 'code' => $obj->CodigoFacultad));
     //         $data['semestreacademico'] = $this->SelectActual(array('id' => 'CodigoSemestre', 'name' => 'CodigoSemestre', 'table' => 'semestreacademico', 'code' => $obj->CodigoSemestre));
     $data['contenido'] = $this->grilla_informativo();
     //        $data['grilla'] = $this->grilla("asignaciontutoria", $cols, $data['data']['rows'], $data['pag'], false, false);
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/contenido/_Index.php');
     $view->setLayout('../template/LayoutInformativo.php');
     $view->render();
 }
開發者ID:AnthonyWainer,項目名稱:sisacreditacion,代碼行數:29,代碼來源:contenidoController.php

示例7: index

 public function index()
 {
     if (!isset($_GET['p'])) {
         $_GET['p'] = 1;
     }
     if (!isset($_GET['q'])) {
         $_GET['q'] = "";
     }
     if (!isset($_GET['criterio'])) {
         $_GET['criterio'] = "descripcion";
     }
     $obj = new plancursos();
     $data = array();
     $data['data'] = $obj->index($_GET['q'], $_GET['p'], $_GET['criterio']);
     //SI EXISTE CRITERIO QUE BUSQUE
     $data['query'] = $_GET['q'];
     $data['pag'] = $this->Pagination(array('rows' => $data['data']['rowspag'], 'url' => 'index.php?controller=plancursos&action=index', 'query' => $_GET['q']));
     $cols = array("CODIGO", "Curso", "HP", "HT", "ESCUELA", "FACULTAD");
     //CABECERA DE LOS CAMPOS DE GRILLA
     $opt = array("idplan" => "CODIGO PLAN");
     //BUSQUEDA DE CAMPOS
     $data['plancurricular'] = $this->Select(array('id' => 'CodigoPlan', 'name' => 'CodigoPlan', 'table' => 'v_plan', 'code' => $obj->CodigoPlan));
     $data['grilla'] = $this->grilla("plancursos", $cols, $data['data']['rows'], $opt, $data['pag'], true, true);
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/plancursos/_Index.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
開發者ID:AnthonyWainer,項目名稱:sisacreditacion,代碼行數:29,代碼來源:plancursosController.php

示例8: index

 public function index()
 {
     if (!isset($_GET['p'])) {
         $_GET['p'] = 1;
     }
     if (!isset($_GET['q'])) {
         $_GET['q'] = "";
     }
     if (!isset($_GET['criterio'])) {
         $_GET['criterio'] = "evento.tema";
     }
     $obj = new eventoT();
     $data = array();
     $semestre_ultimo = $this->mostrar_semestre_ultimo();
     if ($_SESSION['cargo'] == 'Presidente' && $_SESSION['comicion'] == 'COMISION ESPECIAL DE TUTORIA') {
         $presidente = true;
     }
     $data['data'] = $obj->index($_GET['q'], $_GET['p'], $_GET['criterio'], $semestre_ultimo, $_SESSION['idusuario']);
     $data['query'] = $_GET['q'];
     $cols = array("CODIGO", "Tema", "Tipo Evento", "Fecha", "Hora");
     $opt = array("evento.Tema" => "Tema", "evento.fecha" => "Fecha ", "evento.hora" => "Hora");
     $data['grilla'] = $this->grilla("eventoT", $cols, $data['data']['rows'], $opt, $data['pag'], FALSE, FALSE, false, false, false, false, $presidente);
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/eventoT/_Index.php');
     $view->setLayout('../template/Layout3.php');
     $view->render();
 }
開發者ID:AnthonyWainer,項目名稱:sisacreditacion,代碼行數:28,代碼來源:eventoTController.php

示例9: create

 public function create()
 {
     $b = $_POST['a'];
     $data = array();
     $view = new View();
     //$data['comision'] = $this->Select(array('id' => 'idcomision', 'name' => 'idcomision', 'table' => 'comision_cca', 'code' => $obj->idcomision));
     $data['docente'] = $this->Select(array('id' => 'iddocente', 'name' => 'iddocente', 'table' => 'docente_cca', 'code' => $obj->iddocente));
     $view->setData($data);
     if (isset($b)) {
         $view->setTemplate('../view/asignatura_cca/_Form.php');
         $view->setLayout('../template/List.php');
         return $view->render();
     } else {
         $view->setTemplate('../view/asignatura_cca/_Form.php');
         $view->setLayout('../template/Layout.php');
         $view->render();
     }
 }
開發者ID:AnthonyWainer,項目名稱:sisacreditacion,代碼行數:18,代碼來源:cambiar_claveController.php

示例10: index

 public function index()
 {
     $data['semestreacademico'] = $this->cinco_ultimos_semestres(array('id' => 'CodigoSemestre', 'name' => 'CodigoSemestre', 'table' => 'semestreacademico', 'code' => $obj->CodigoSemestre));
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/misasistenciasAlumno/_Index.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
開發者ID:ewo1991,項目名稱:sisacreditacion,代碼行數:9,代碼來源:misasistenciasAlumnoController.php

示例11: index

 public function index()
 {
     $data = array();
     $data['semestreacademico'] = $this->Select1(array('id' => 'semestreacademico', 'name' => 'semestreacademico', 'filtro' => $_SESSION['idusuario']));
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/alumnoproyecto/_Index.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
開發者ID:ewo1991,項目名稱:sisacreditacion,代碼行數:10,代碼來源:alumnoproyectosController.php

示例12: create

 public function create()
 {
     $data = array();
     $view = new View();
     $data['tipo_bibliografia'] = $this->Select(array('id' => 'idtipo_bibliografia', 'name' => 'idtipo_bibliografia', 'table' => 'tipo_bibliografia', 'code' => $obj->idtipo_bibliografia));
     $view->setData($data);
     $view->setTemplate('../view/bibliografia/_Form.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
開發者ID:AnthonyWainer,項目名稱:sisacreditacion,代碼行數:10,代碼來源:bibliografiaController.php

示例13: index

 public function index()
 {
     $data = array();
     $data['sucursal'] = $this->Select(array('id' => 'idsucursal', 'name' => 'idsucursal', 'table' => 'sucursal'));
     $view = new View();
     $view->setData($data);
     $view->setTemplate('../view/_seleccion.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
開發者ID:ewo1991,項目名稱:sisacreditacion,代碼行數:10,代碼來源:seleccionController.php

示例14: execute

 public function execute()
 {
     if (Request::getModule() == 'user' and Request::getAction() == 'login' || strtolower(Request::getAction()) == 'loginsubmit') {
     } else {
         if ($_SESSION['user_id'] == '') {
             Zee::redirect(Zee::url("user", "login"));
         }
     }
     View::setLayout('default.tpl.php');
 }
開發者ID:happyxlq,項目名稱:pd,代碼行數:10,代碼來源:PreFilter.class.php

示例15: Index

 public function Index()
 {
     $data = array();
     $view = new View();
     $data['perfiles'] = $this->Select(array('id' => 'idperfil', 'name' => 'idperfil', 'table' => 'perfil'));
     $view->setData($data);
     $view->setTemplate('../view/Permisos/_Permisos.php');
     $view->setLayout('../template/Layout.php');
     $view->render();
 }
開發者ID:ewo1991,項目名稱:sisacreditacion,代碼行數:10,代碼來源:PermisosController.php


注:本文中的View::setLayout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。