本文整理汇总了PHP中core\View::render方法的典型用法代码示例。如果您正苦于以下问题:PHP View::render方法的具体用法?PHP View::render怎么用?PHP View::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core\View
的用法示例。
在下文中一共展示了View::render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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>
<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);
}
示例2: login
public function login()
{
Hooks::addHook('js', 'Controllers\\auth@js');
Hooks::addHook('css', 'Controllers\\auth@css');
$error = 'hi';
$success = 'hi';
if (Session::get('loggedin')) {
Url::redirect();
}
if (isset($_POST['submit'])) {
$username = $_POST['username'];
$password = $_POST['password'];
//validation
if (Password::verify($password, $this->_model->getHash($username)) == false) {
$error[] = 'Wrong username or password';
}
//if validation has passed carry on
if (!$error) {
Session::set('loggedin', true);
Session::set('username', $username);
Session::set('memberID', $this->_model->getID($username));
$data = array('lastLogin' => date('Y-m-d G:i:s'));
$where = array('memberID' => $this->_model->getID($username));
$this->_model->update($data, $where);
$error = 'hi';
Url::redirect();
}
}
$data['title'] = 'Login';
View::rendertemplate('header', $data);
View::render('auth/login', $data, $error, $success);
View::rendertemplate('footer', $data);
}
示例3: login
public function login()
{
if (Session::get('loggedin')) {
Url::redirect('admin');
}
$model = new \Models\Admin\Auth();
$data['title'] = 'Login';
if (isset($_POST['submit'])) {
$username = $_POST['member_username'];
$password = $_POST['member_password'];
if (Password::verify($_POST['member_password'], $model->getHash($_POST['member_username'])) == 0) {
$error[] = 'Wrong username of password';
} else {
$data['user_infos'] = $model->get_user_infos($_POST['member_username']);
Session::set('member_id', $data['user_infos'][0]->member_id);
Session::set('member_username', $username);
Session::set('member_password', '' . $password . '');
Session::set('loggedin', true);
Url::redirect('admin');
}
}
View::renderadmintemplate('loginheader', $data);
View::render('admin/login', $data, $error);
View::renderadmintemplate('footer', $data);
}
示例4: index
public function index()
{
$data['title'] = $this->language->get('Voorwaarden');
View::renderTemplate('header', $data);
View::render('home/voorwaarden', $data);
View::renderTemplate('footer', $data);
}
示例5: index
public function index()
{
$data['title'] = 'Admin';
View::renderadmintemplate('header', $data);
View::render('admin/admin', $data);
View::renderadmintemplate('footer', $data);
}
示例6: index
public function index()
{
$data['subtitle'] = 'Welcome';
View::render('header', $data);
View::render('home');
View::render('footer');
}
示例7: index
public function index()
{
$data['title'] = "Inicio";
View::renderTemplate('header', $data);
View::render('inicio/inicio', $data);
View::renderTemplate('footer', $data);
}
示例8: view
/**
* @param $view
* @param null $params
*
* @return View
*/
public function view($view, $params = null)
{
$params['Config'] = new Config();
$params['Date'] = new Carbon();
$params['Utils'] = new Utils();
View::render($view, $params);
}
示例9: userLogin
/**
* User login
*/
public function userLogin($app_info)
{
$data['id'] = $app_info->app_id;
$data['version'] = $app_info->app_version;
$data['dir'] = DIR;
View::render('login', $data);
}
示例10: 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);
}
示例11: 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);
}
示例12: exceptionHandler
/**
* Exception handler.
*
*/
public static function exceptionHandler($exception)
{
// Code is 404 [not found] or 500 [general error]
$code = $exception->getCode();
if ($code != 404) {
$code = 500;
}
http_response_code($code);
if (Config::SHOW_ERRORS) {
echo '<h1>Fatal error</h1>';
echo "<p>Uncaught exception: '" . get_class($exception) . "'</p>";
echo "<p>Message: '" . $exception->getMessage() . "'</p>";
echo '<p>Stack trace:<pre>' . $exception->getTraceAsString() . '</pre></p>';
echo "<p>Thrown in '" . $exception->getFile() . "' on line " . $exception->getLine() . '</p>';
} else {
$log = dirname(__DIR__) . '/logs/' . date('Y-m-d') . '.txt';
ini_set('error_log', $log);
$message = "Uncaught exception: '" . get_class($exception) . "'";
$message .= " with message '" . $exception->getMessage() . "'";
$message .= "\nStack trace: " . $exception->getTraceAsString();
$message .= "\nThrown in '" . $exception->getFile() . "' in line " . $exception->getLine();
error_log($message);
View::render("error/{$code}");
}
}
示例13: 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);
}
示例14: index
public function index()
{
if (isset($_POST['submit'])) {
$this->model->sendPm();
}
View::render('landing/sendpm', $data);
}
示例15: 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);
}