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


PHP View::renderTemplate方法代碼示例

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


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

示例1: index

 public function index()
 {
     $cache = new \Helpers\SimpleCache();
     $forecastApi = json_decode($cache->get_data('forecast', 'http://www.prevision-meteo.ch/services/json/colmar'), TRUE);
     $data["title"] = "Prévisions";
     $data['csrf_token'] = Csrf::makeToken();
     $data["tempMin+1"] = $forecastApi["fcst_day_1"]["tmin"];
     $data["tempMax+1"] = $forecastApi["fcst_day_1"]["tmax"];
     $data["tempMin+2"] = $forecastApi["fcst_day_2"]["tmin"];
     $data["tempMax+2"] = $forecastApi["fcst_day_2"]["tmax"];
     $data["tempMin+3"] = $forecastApi["fcst_day_3"]["tmin"];
     $data["tempMax+3"] = $forecastApi["fcst_day_3"]["tmax"];
     $data["tempMin+4"] = $forecastApi["fcst_day_4"]["tmin"];
     $data["tempMax+4"] = $forecastApi["fcst_day_4"]["tmax"];
     $data["resume+1"] = $forecastApi["fcst_day_1"]["condition"];
     $data["resume+2"] = $forecastApi["fcst_day_2"]["condition"];
     $data["resume+3"] = $forecastApi["fcst_day_3"]["condition"];
     $data["resume+4"] = $forecastApi["fcst_day_4"]["condition"];
     $data["icon+1"] = $forecastApi["fcst_day_1"]["icon"];
     $data["icon+2"] = $forecastApi["fcst_day_2"]["icon"];
     $data["icon+3"] = $forecastApi["fcst_day_3"]["icon"];
     $data["icon+4"] = $forecastApi["fcst_day_4"]["icon"];
     $data['javascript'] = array('AjaxControllers/Forecast/forecast');
     View::renderTemplate('header', $data);
     View::render('forecast/index', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:XxP1asmaxX,項目名稱:MeteoColmar,代碼行數:27,代碼來源:Forecast.php

示例2: index

 public function index()
 {
     $data['title'] = "Sistema de Administración de Aerolíneas";
     $data['page'] = "page3";
     if (!is_null(filter_input(INPUT_POST, 'insertar'))) {
         $matricula = $_POST['matricula'];
         $asientos = $_POST['asientos'];
         $id_aerolinea = $_POST['id_aerolinea'];
         $datos = array('ASIENTOS' => $matricula, 'MATRICULA' => $asientos, 'AEROLINEA_ID' => $id_aerolinea);
         $this->_model->insertar_avion($datos);
         Url::redirect("aviones?aer=1");
     } elseif (!is_null(filter_input(INPUT_POST, 'eliminar'))) {
         $id_aerolinea = $_POST['id_avion'];
         $where = array('avion_id' => $id_aerolinea);
         $this->_model->eliminar_avion($where);
     } elseif (!is_null(filter_input(INPUT_POST, 'editar'))) {
         $matricula = $_POST['matricula'];
         $asientos = $_POST['asientos'];
         $id_aerolinea = $_POST['id_aerolinea'];
         $id_avion = $_POST['id_avion'];
         $datos = array('ASIENTOS' => $matricula, 'MATRICULA' => $asientos, 'AEROLINEA_ID' => $id_aerolinea);
         $where = array('avion_id' => $id_avion);
         $this->_model->actualizar_avion($datos, $where);
     }
     $data['aerolineas'] = $this->_model->obtener_aerolineas();
     $data['aviones'] = $this->_model->obtener_aviones();
     View::renderTemplate('header', $data);
     View::render('aviones/aviones', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:alejandrozepeda,項目名稱:admin,代碼行數:30,代碼來源:Aviones.php

示例3: affichageScore

 public function affichageScore($num)
 {
     $data['title'] = "Les scores";
     $userSQL = new PersonneSQL();
     $user = $userSQL->prepareFindAll()->execute();
     // /!\ A ajouter dans le tableau data les scores correspondant au joueur quand il y aura des scores
     $score = new ScoreSQL();
     $condi = array();
     foreach ($user as $p) {
         $condi[] = "idPlayer = " . $p->id . " and idMap =" . $num;
     }
     $scores = array();
     $infos = array();
     for ($i = 0; $i < count($condi); $i++) {
         $scores[] = $score->prepareFindWithCondition($condi[$i])->execute();
     }
     for ($i = 0; $i < count($scores); $i++) {
         for ($j = 0; $j < count($scores[$i]); $j++) {
             $infos[] = $scores[$i][$j];
         }
     }
     $data['scores'] = $infos;
     $data['taille'] = count($infos);
     for ($i = 0; $i < count($infos); $i++) {
         $data['scores']['pseudos'][] = $userSQL->getPseudoById($data['scores'][$i]->idPlayer);
     }
     View::renderTemplate('header', $data);
     View::render('scores/scores', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:jordandevolder,項目名稱:Algogoal,代碼行數:30,代碼來源:Scores.php

示例4: register

 public function register()
 {
     if (Session::get('logged')) {
         Url::redirect();
     }
     $data['title'] = 'הרשמה';
     if (isset($_POST['submit'])) {
         $username = $_POST['username'];
         $password = $_POST['password'];
         $email = $_POST['email'];
         if ($username == '') {
             $error[] = 'שם משתמש הוא שדה נדרש';
         }
         if ($this->_model->get_user($username)) {
             $error[] = 'שם המשתמש תפוס, בעסה';
         }
         if ($password == '') {
             $error[] = 'צריך סיסמא כדי להירשם, אחרת כל אחד יוכל להיכנס במקומך...';
         }
         if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
             $error[] = 'כדי להירשם צריך מייל, למקרה ששכחת את הסיסמא';
         }
         if (!$error) {
             $postdata = array('user_name' => $username, 'user_password' => Password::make($password), 'user_email' => $email);
             $this->_model->add_user($postdata);
             $this->login_user($username);
             //        Session::set('message','User Added');
             Url::redirect();
         }
     }
     View::renderTemplate('header', $data);
     View::render('register', $data, $error);
     View::renderTemplate('footer', $data);
 }
開發者ID:Zed3,項目名稱:foodie,代碼行數:34,代碼來源:Auth.php

示例5: adsb

 public function adsb()
 {
     $data["title"] = "Trafic Aérien";
     View::renderTemplate('header', $data);
     View::render('pages/adsb', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:XxP1asmaxX,項目名稱:MeteoColmar,代碼行數:7,代碼來源:Pages.php

示例6: index

 public function index()
 {
     $data['title'] = $this->language->get('beheer klanten');
     $rechten = \Helpers\Session::get('rechten') - 1;
     $result = $this->getData('klanten', $rechten);
     $i = 1;
     foreach ($result as $key) {
         $data["users"] .= '
             <tr>
                 <td>' . $i . '</td>
                 <td>' . $key->voornaam . '</td>
                 <td>' . $key->tussenvoegsel . '</td>
                 <td>' . $key->achternaam . '</td>
                 <td>' . $key->email . '</td>
                 <td style="text-align: right">
                     <a href="#" data-id="' . $key->klant_id . '" class="EditRow"><i class="fa fa-pencil-square-o fa-lg"></i></a>&nbsp;
                     <a href="#" data-id="' . $key->klant_id . '" class="DeleteRow"><i class="fa fa-times fa-lg"></i></a>
                 </td>
             </tr>
         ';
         $i++;
     }
     View::renderTemplate('header', $data);
     View::render('beheer/beheerklanten', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:Aukevanoost,項目名稱:zeilschooldewaai,代碼行數:26,代碼來源:beheerKlanten.php

示例7: index

 public function index()
 {
     $data['title'] = $this->language->get('Voorwaarden');
     View::renderTemplate('header', $data);
     View::render('home/voorwaarden', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:Aukevanoost,項目名稱:zeilschooldewaai,代碼行數:7,代碼來源:Voorwaarden.php

示例8: index

 /**
  * Define Index page title and load template files
  */
 public function index()
 {
     $data['title'] = "Mini IMDB";
     View::renderTemplate('header', $data);
     View::render('movies/homepage', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:BryanYeh,項目名稱:Movies,代碼行數:10,代碼來源:Home.php

示例9: file

 public function file()
 {
     $fileID = array_keys($_GET);
     $fileID = str_replace('files/', '', $fileID[0]);
     $fileInfo = $this->_files->getFileInfo($fileID);
     if (empty($fileInfo)) {
         header("{$_SERVER['SERVER_PROTOCOL']} 404 Not Found");
         $data['title'] = '404';
         $data['error'] = "Страница не найдена.";
         View::render('Error/404');
         die;
     }
     $data['title'] = $fileInfo['file_name'];
     $data['fileinfo'] = $fileInfo;
     if ($data['fileinfo']['file_type'] == 'image/jpg' || $data['fileinfo']['file_type'] == 'image/gif' || $data['fileinfo']['file_type'] == 'image/png') {
         $data['imageinfo'] = getimagesize($_SERVER['DOCUMENT_ROOT'] . '/uploads/' . $data['fileinfo']['server_name']);
     }
     if ($data['fileinfo']['file_type'] == 'image/jpg' || $data['fileinfo']['file_type'] == 'image/tiff') {
         $data['imageinfo']['saved'] = exif_read_data($_SERVER['DOCUMENT_ROOT'] . '/uploads/' . $data['fileinfo']['server_name']);
     }
     $fileType = array_shift(explode('/', $data['fileinfo']['file_type']));
     if ($fileType == 'video' || $fileType == 'audio') {
         $getID3 = new GetId3();
         $data['mediainfo'] = $getID3->setEncoding('UTF-8')->analyze($_SERVER['DOCUMENT_ROOT'] . '/uploads/' . $data['fileinfo']['server_name']);
     }
     $data['comments'] = $this->_files->getAllComments($fileID);
     $data['token'] = $this->makeToken();
     View::renderTemplate('header', $data);
     View::render('files/file', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:Nattpyre,項目名稱:rocketfiles,代碼行數:31,代碼來源:Files.php

示例10: index

 public function index()
 {
     // editable if admin privileges
     $admin_privilege = false;
     if (isset($_SESSION['user_info'])) {
         if ($_SESSION['user_info']->privilege >= 5) {
             // admin privilege level
             $admin_privilege = true;
         }
     }
     // get parents
     $parents = $this->db->getParents();
     $data["info"] = array();
     // get children
     foreach ($parents as $parent) {
         $buffer = array($parent);
         // get title
         $children = $this->db->getChildren($parent);
         foreach ($children as $child) {
             array_push($buffer, $child);
         }
         array_push($data["info"], $buffer);
     }
     // display information
     $data['title'] = 'Task';
     View::renderTemplate('header', $data);
     View::render('task/task', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:maksym-gryb,項目名稱:portfolio,代碼行數:29,代碼來源:Task.php

示例11: index

 public function index()
 {
     $data['title'] = "Inicio";
     View::renderTemplate('header', $data);
     View::render('inicio/inicio', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:alejandrozepeda,項目名稱:docstify,代碼行數:7,代碼來源:Inicio.php

示例12: index

 public function index()
 {
     $data['title'] = "Sistema de Administración de Aerolíneas";
     $data['page'] = "page2";
     if (!is_null(filter_input(INPUT_POST, 'insertar'))) {
         $nombre = $_POST['nombre'];
         $responsable = $_POST['responsable'];
         $numero = $_POST['numero'];
         $email = $_POST['correo'];
         $datos = array('NOMBRE' => $nombre, 'NOMBRE_RESPONSABLE' => $responsable, 'AVIONES' => $numero, 'EMAIL' => $email);
         $this->_model->insertar_aerolinea($datos);
         Url::redirect("aerolineas?aer=1");
     } elseif (!is_null(filter_input(INPUT_POST, 'eliminar'))) {
         $id_aerolinea = $_POST['id_aerolinea'];
         $where = array('aerolinea_id' => $id_aerolinea);
         $this->_model->eliminar_aerolinea($where);
     } elseif (!is_null(filter_input(INPUT_POST, 'editar'))) {
         $nombre = $_POST['nombre'];
         $responsable = $_POST['responsable'];
         $numero = $_POST['numero'];
         $email = $_POST['correo'];
         $id_aerolinea = $_POST['id_aerolinea'];
         $data = array('NOMBRE' => $nombre, 'NOMBRE_RESPONSABLE' => $responsable, 'AVIONES' => $numero, 'EMAIL' => $email);
         $where = array('aerolinea_id' => $id_aerolinea);
         $this->_model->actualizar_aerolinea($data, $where);
     }
     $data['aerolineas'] = $this->_model->obtener_aerolineas();
     $data['aviones'] = $this->_model->obtener_aviones();
     View::renderTemplate('header', $data);
     View::render('aerolineas/aerolineas', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:alejandrozepeda,項目名稱:admin,代碼行數:32,代碼來源:Aerolineas.php

示例13: index

 public function index()
 {
     $data = array();
     View::renderTemplate("NewPortalHeader", $data, 'MetroTemplate');
     View::render("portal/Portal", $data);
     View::renderTemplate("footer", $data, 'MetroTemplate');
 }
開發者ID:hieunguyenbk,項目名稱:AgriExtension,代碼行數:7,代碼來源:NewPortalController.php

示例14: developers

 public function developers()
 {
     $data['title'] = $this->language->get('Developerteam');
     View::renderTemplate('header', $data);
     View::render('home/developers', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:Aukevanoost,項目名稱:zeilschooldewaai,代碼行數:7,代碼來源:Home.php

示例15: login

 public function login()
 {
     if (Session::get('loggedin')) {
         Url::redirect('admin-panel');
     }
     $data['title'] = 'Login';
     if (isset($_POST['submit'])) {
         $correo = $_POST['correo'];
         $password = $_POST['password'];
         if ($correo == '' || !isset($correo)) {
             $data['error'][0] = 'Correo es un campo obligatorio';
         }
         if ($password == '' || !isset($password)) {
             $data['error'][1] = 'Password es un campo obligatorio';
         }
         if (Password::verify($password, $this->_model->getHash($correo)) == false) {
             $data['error'][2] = 'Correo o password incorrectos';
         }
         if (!$data['error']) {
             $data['usuario'] = $this->_model->getUsuario($correo);
             Session::set('loggedin', true);
             Session::set('idUsuario', $data[usuario][0]->idUsuario);
             Session::set('nombre', $data[usuario][0]->nombre);
             Session::set('apellidoPaterno', $data[usuario][0]->apellidoPaterno);
             $dataUsuario = array('fechaConexion' => date("Y-m-d H:i:s"));
             $where = array('correo' => $correo);
             $this->_model->updateUsuario($dataUsuario, $where);
             Url::redirect('admin-panel');
         }
     }
     View::renderTemplate('header', $data);
     View::render('Auth/Login', $data);
     View::renderTemplate('footer', $data);
 }
開發者ID:alejandrozepeda,項目名稱:dcorrido,代碼行數:34,代碼來源:Auth.php


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