本文整理汇总了PHP中View::setTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP View::setTemplate方法的具体用法?PHP View::setTemplate怎么用?PHP View::setTemplate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::setTemplate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Methode zum anzeigen des Contents.
*
* @return String Content der Applikation.
*/
public function display()
{
$view = new View();
switch ($this->template) {
case 'createTables':
$view->setTemplate('createTables');
$oApi = new api();
$aResult = $oApi->createDatabase();
$view->assign('state', $aResult);
break;
case 'config':
$view->setTemplate('config');
if (!empty($this->sleep)) {
Model::setConfigSleepData($this->sleep);
}
$aConfigData = Model::getConfigSleepData();
$view->assign('config', $aConfigData);
break;
case 'report':
$view->setTemplate('report');
$view->assign('state', $this->state);
$aReportData = Model::getReportData();
$view->assign('data', $aReportData);
if (!empty($this->request['a'])) {
switch ($this->request['a']) {
case 1:
break;
case 2:
$view->assign('users', Model::getUser());
if ($this->user) {
$view->assign('reportDataByUser', Model::getReportDataByParams('reportUsers', $this->user));
} else {
$view->assign('reportDataByUser', Model::getReportDataByParams('reportUsers', '%%'));
}
break;
case 3:
$view->assign('reportDataApps', Model::getReportDataByApps());
break;
case 4:
$view->assign('reportDataMac', Model::getReportDataByParams('reportMac', '%%'));
break;
default:
}
}
break;
default:
$view->setTemplate('start');
}
return $view->loadTemplate();
}
示例2: 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();
}
}
}
示例3: config
public function config()
{
$view = new View();
$view->setTemplate('../view/_PanelConfig.php');
$view->setLayout('../template/Layout.php');
$view->render();
}
示例4: index
/**
* Default action
* @param $args array
*/
public function index(array $args = array())
{
$hooks = array();
\View::set('registerLayoutHooks', $hooks);
\View::set('username', isset($_POST['username']) ? $_POST['username'] : '');
\View::set('email', isset($_POST['email']) ? $_POST['email'] : '');
\View::set('password', isset($_POST['password']) ? $_POST['password'] : '');
\View::set('pageTitle', 'Register');
$auth = $this->app->getModel('player');
if (isset($_POST['register'])) {
$insert = array();
$insert['username'] = $_POST['username'];
$insert['email'] = $_POST['email'];
$insert['password'] = $_POST['password'];
$insert['confirm_password'] = $_POST['password2'];
try {
/* Attempt to register the account */
$register = $auth->create($insert);
} catch (\Exception $e) {
$message = '<strong>You could not be registered:</strong><ul>';
foreach (unserialize($e->getMessage()) as $prev) {
$message .= '<li>' . $prev->getMessage() . '</li>';
}
$message .= '</ul>';
\View::setMessage($message, 'warn');
}
/* If the account is active, redirect the user to the login page */
if (isset($register['active']) && $register['active'] == '1') {
\View::setMessage('Your accounts was successfully created. You may now log in.', 'success');
} elseif (isset($register['active']) && $register['active'] == '0') {
\View::setMessage('Your account has been created, but requires activation.', 'success');
\View::setTemplate('Index.twig');
}
}
}
示例5: display
public function display()
{
$view = new View();
$view->setTemplate('header');
$view->assign('title', 'openmuseum');
return $view->loadTemplate();
}
示例6: 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();
}
示例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();
}
示例8: __construct
/**
*
* @param Resource $resource
* @param Request $request
*/
public function __construct(Resource $resource, Request $request)
{
$this->resource = $resource;
$this->request = $request;
$viewClass = $resource->getViewType() == null ? Registry::get("DEFAULT_VIEW") : $resource->getViewType();
$this->view = new $viewClass($request->debug);
if ($resource->getViewTemplate() != null) {
$this->view->setTemplate($resource->getViewTemplate());
}
if (Registry::get("COMPRESS_OUTPUT")) {
ob_start("ob_gzhandler");
}
if (!headers_sent()) {
session_start();
}
}
示例9: index
/**
* Default action.
*
* @param $args array
*/
public function index(array $args = array())
{
$error = null;
$playerModel = \App::getModel('Player');
$session = \App::getModel('Session');
if (empty($_POST['username']) || empty($_POST['password'])) {
$error = 'Please enter your username and password!';
} else {
try {
$player = $playerModel->authenticate($_POST['username'], $_POST['password']);
} catch (\Exception $e) {
$error = 'Invalid username and/or password.';
if (\Config::get('security.login.showInvalidLoginReason')) {
$error = $e->getMessage();
}
}
}
if (isset($error)) {
$session->clear();
$error = '<strong>Sorry, you could not be logged in...</strong><br />' . $error;
\View::setMessage($error, 'fail');
/* Changed from a header to just grabbing the view itself */
\View::setTemplate('Index.twig');
\View::set('credentials', array('username' => \Config::get('security.login.returnUsernameOnFailure') ? isset($_POST['username']) ? $_POST['username'] : '' : ''));
}
}
示例10: display
public function display()
{
$view = new View();
$view->setTemplate('navBar');
$view->assign('active', $this->active);
return $view->loadTemplate();
}
示例11: 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();
}
示例12: display
public function display()
{
$view = new View();
// äussere View
$contentView = new View();
$this->daten['menu'] = Model::getMenu();
switch ($this->action) {
case "liste":
// Methode aus Model wird aufgerufen
// ohne Instanz
$this->daten['content'] = Model::getDaten();
$contentView->setDaten($this->daten['content']);
// gibt Daten an Innerview
$contentView->setTemplate("liste");
// gibt Template an Innerview
break;
case "inputform":
$contentView->setTemplate("inputform");
break;
case "inputformprocessing":
$z = Model::setDaten($_REQUEST['vorname'], $_REQUEST['nachname'], $_REQUEST['alter']);
$this->daten['content'] = Model::getDataset($z);
$contentView->setDaten($this->daten['content']);
$contentView->setTemplate("oneDataset");
// gibt Template an Innerview
break;
case "delete":
echo "delete";
break;
default:
// Template "home" mit Text für Default
// Textausgaben: "Programm zur Datenverwaltung
$contentView->setTemplate("home");
break;
}
// wir laden das Template der inneren View und schieben
// die entstandenen Daten in die äußeren View
$view->setDaten(array("content" => $contentView->loadTemplate(), "menu" => $this->daten['menu']));
// wir laden das Template der äußeren View
$output = $view->loadTemplate();
if ($output) {
echo $output;
} else {
echo "Fehler";
}
}
示例13: index
/**
* Default action
*/
public function index()
{
if (!headers_sent()) {
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
}
\View::setTemplate('Error.twig');
}
示例14: 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();
}
}
示例15: 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();
}