本文整理汇总了PHP中loadView函数的典型用法代码示例。如果您正苦于以下问题:PHP loadView函数的具体用法?PHP loadView怎么用?PHP loadView使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loadView函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
public function login()
{
if (!$this->__redirectAccess()) {
$this->load->helper('form');
$this->load->library('form_validation');
$this->form_validation->set_rules('email', 'Email', 'required|valid_email|trim|xss_clean');
$this->form_validation->set_rules('passcode', 'Passcode', 'trim|required|callback_check_login|xss_clean');
$this->form_validation->set_message('required', ' error ');
$this->form_validation->set_error_delimiters('', '');
if ($this->form_validation->run() === FALSE) {
loadView('authentication', 'index');
} else {
$this->login();
}
}
}
示例2: resetShippingUserPass
public function resetShippingUserPass($key)
{
if (empty($key)) {
$newdata = array('error' => "<font color='red'>Invalid Action</font>");
$this->session->set_flashdata($newdata);
redirect('/');
} else {
$this->load->model('User_model');
$user = $this->User_model->getUserByKey($key);
if (count($user) > 0) {
loadView("resetShippingUserPass", array('user' => $user));
} else {
$newdata = array('error' => "<font color='red'>Invalid key or key has been expired.</font>");
$this->session->set_flashdata($newdata);
redirect('/');
}
}
}
示例3: __renderTemplate
/**
* Render the contents using the current layout and template.
*
* @param string $content Content to render
* @return string Email ready to be sent
* @access private
*/
function __renderTemplate($content)
{
$viewClass = $this->Controller->view;
if ($viewClass != 'View') {
if (strpos($viewClass, '.') !== false) {
list($plugin, $viewClass) = explode('.', $viewClass);
}
$viewClass = $viewClass . 'View';
loadView($this->Controller->view);
}
$View = new $viewClass($this->Controller, false);
$View->layout = $this->layout;
$msg = null;
if ($this->sendAs === 'both') {
$htmlContent = $content;
if (!empty($this->attachments)) {
$msg .= '--' . $this->__boundary . $this->_newLine;
$msg .= 'Content-Type: multipart/alternative; boundary="alt-' . $this->__boundary . '"' . $this->_newLine . $this->_newLine;
}
$msg .= '--alt-' . $this->__boundary . $this->_newLine;
$msg .= 'Content-Type: text/plain; charset=' . $this->charset . $this->_newLine;
$msg .= 'Content-Transfer-Encoding: 7bit' . $this->_newLine . $this->_newLine;
$content = $View->renderElement('email' . DS . 'text' . DS . $this->template, array('content' => $content), true);
$View->layoutPath = 'email' . DS . 'text';
$msg .= $View->renderLayout($content) . $this->_newLine;
$msg .= $this->_newLine . '--alt-' . $this->__boundary . $this->_newLine;
$msg .= 'Content-Type: text/html; charset=' . $this->charset . $this->_newLine;
$msg .= 'Content-Transfer-Encoding: 7bit' . $this->_newLine . $this->_newLine;
$content = $View->renderElement('email' . DS . 'html' . DS . $this->template, array('content' => $htmlContent), true);
$View->layoutPath = 'email' . DS . 'html';
$msg .= $View->renderLayout($content) . $this->_newLine . $this->_newLine;
$msg .= '--alt-' . $this->__boundary . '--' . $this->_newLine . $this->_newLine;
return $msg;
}
if (!empty($this->attachments)) {
if ($this->sendAs === 'html') {
$msg .= $this->_newLine . '--' . $this->__boundary . $this->_newLine;
$msg .= 'Content-Type: text/html; charset=' . $this->charset . $this->_newLine;
$msg .= 'Content-Transfer-Encoding: 7bit' . $this->_newLine . $this->_newLine;
} else {
$msg .= '--' . $this->__boundary . $this->_newLine;
$msg .= 'Content-Type: text/plain; charset=' . $this->charset . $this->_newLine;
$msg .= 'Content-Transfer-Encoding: 7bit' . $this->_newLine . $this->_newLine;
}
}
$content = $View->renderElement('email' . DS . $this->sendAs . DS . $this->template, array('content' => $content), true);
$View->layoutPath = 'email' . DS . $this->sendAs;
$msg .= $View->renderLayout($content) . $this->_newLine;
return $msg;
}
示例4: preg_replace
$permissionsJoin = $permissionsWhere ? ", `membership_userrecords`" : '';
// build the count query
$forcedWhere = $userPCConfig[$ChildTable][$ChildLookupField]['forced-where'];
$query = preg_replace('/^select .* from /i', 'SELECT count(1) FROM ', $userPCConfig[$ChildTable][$ChildLookupField]['query']) . $permissionsJoin . " WHERE " . ($permissionsWhere ? "( {$permissionsWhere} )" : "( 1=1 )") . " AND " . ($forcedWhere ? "( {$forcedWhere} )" : "( 2=2 )") . " AND " . "`{$ChildTable}`.`{$ChildLookupField}`='" . makeSafe($SelectedID) . "'";
$totalMatches = sqlValue($query);
// make sure $Page is <= max pages
$maxPage = ceil($totalMatches / $userPCConfig[$ChildTable][$ChildLookupField]['records-per-page']);
if ($Page > $maxPage) {
$Page = $maxPage;
}
// initiate output data array
$data = array('config' => $userPCConfig[$ChildTable][$ChildLookupField], 'parameters' => array('ChildTable' => $ChildTable, 'ChildLookupField' => $ChildLookupField, 'SelectedID' => $SelectedID, 'Page' => $Page, 'SortBy' => $SortBy, 'SortDirection' => $SortDirection, 'Operation' => 'get-records'), 'records' => array(), 'totalMatches' => $totalMatches);
// build the data query
if ($totalMatches) {
// if we have at least one record, proceed with fetching data
$startRecord = $userPCConfig[$ChildTable][$ChildLookupField]['records-per-page'] * ($Page - 1);
$data['query'] = $userPCConfig[$ChildTable][$ChildLookupField]['query'] . $permissionsJoin . " WHERE " . ($permissionsWhere ? "( {$permissionsWhere} )" : "( 1=1 )") . " AND " . ($forcedWhere ? "( {$forcedWhere} )" : "( 2=2 )") . " AND " . "`{$ChildTable}`.`{$ChildLookupField}`='" . makeSafe($SelectedID) . "'" . ($SortBy !== false && $userPCConfig[$ChildTable][$ChildLookupField]['sortable-fields'][$SortBy] ? " ORDER BY {$userPCConfig[$ChildTable][$ChildLookupField]['sortable-fields'][$SortBy]} {$SortDirection}" : '') . " LIMIT {$startRecord}, {$userPCConfig[$ChildTable][$ChildLookupField]['records-per-page']}";
$res = sql($data['query'], $eo);
while ($row = db_fetch_row($res)) {
$data['records'][$row[$userPCConfig[$ChildTable][$ChildLookupField]['child-primary-key-index']]] = $row;
}
} else {
// if no matching records
$startRecord = 0;
}
$response = loadView($userPCConfig[$ChildTable][$ChildLookupField]['template'], $data);
// change name space to ensure uniqueness
$uniqueNameSpace = $ChildTable . ucfirst($ChildLookupField) . 'GetRecords';
echo str_replace("{$ChildTable}GetChildrenRecordsList", $uniqueNameSpace, $response);
/************************************************/
}
示例5: setcookie
if (isset($_GET["logout"])) {
// Delete session, remove cookies to logout
// http://php.net/manual/en/function.session-destroy.php
setcookie("id", "", time() - 42000);
setcookie("username", "", time() - 42000);
setcookie(session_name(), "", time() - 42000);
session_destroy();
redirect("");
}
loadView("home");
} else {
if (isset($_POST["username"]) && isset($_POST["password"])) {
// Check if user with given credentials exists
$result = execSQL("SELECT * FROM users WHERE username='" . strtolower($_POST["username"]) . "' AND password='" . sha1($_POST["password"]) . "'");
if ($result->num_rows > 0) {
// Correct username and password
while ($row = $result->fetch_assoc()) {
$expire = 60 * 60 * 12;
// Cookies expire in 12 hours
setcookie("id", $row["id"], time() + $expire);
setcookie("username", $row["username"], time() + $expire);
}
redirect("");
} else {
redirect("?wrong");
}
} else {
loadView("welcome");
}
}
include "footer.php";
示例6: trans_mrs2016_after_insert
/**
* Called after executing the insert query (but before executing the ownership insert query).
*
* @param $data
* An associative array where the keys are field names and the values are the field data values that were inserted into the new record.
* For this table, the array items are:
* $data['firstname'], $data['lastname'], $data['email'], $data['phone'], $data['quantity'], $data['amount'], $data['mailinglist'], $data['remarks'], $data['transactiondate'], $data['seller'], $data['editingdate'], $data['editor']
* Also includes the item $data['selectedID'] which stores the value of the primary key for the new record.
*
* @param $memberInfo
* An array containing logged member's info.
* @see http://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks/memberInfo
*
* @param $args
* An empty array that is passed by reference. It's currently not used but is reserved for future uses.
*
* @return
* A boolean TRUE to perform the ownership insert operation or FALSE to cancel it.
* Warning: if a FALSE is returned, the new record will have no ownership info.
*/
function trans_mrs2016_after_insert($data, $memberInfo, &$args)
{
/* check if user add quantity value or not */
if (!$data['quantity']) {
return FALSE;
}
/* create child records in duck_mrs2016 table after inserting parent */
$transaction_id = $data['transaction_id'];
$creation_date = date("j-n-Y");
$table_name = 'duck_mrs2016';
/* member info */
$member_id = $memberInfo['username'];
$group_id = $memberInfo['groupID'];
$date_updated = $date_added = time();
/* array to insert all ducks in duck_mrs2016 table */
$sql_to_duck_mrs2016 = array();
/* array to insert all ducks in membership_userrecords table */
$sql_to_membership_userrecords = array();
/* get last inserted id in duck_mrs2016 table to calculate pks */
$duck_id = sqlValue("select max(duck_id) from `duck_mrs2016`");
/* list of all duck id's */
$duck_ids = array();
for ($i = 0; $i < $data['quantity']; $i++) {
$sql_to_duck_mrs2016[] = "('{$transaction_id}','{$creation_date}')";
/* check if there is value of duck_id */
$pk = empty($duck_id) ? $i + 1 : $duck_id + $i + 1;
$sql_to_membership_userrecords[] = "('{$table_name}','{$pk}','{$member_id}','{$date_added}','{$date_updated}','{$creation_date}')";
$duck_ids[] = $pk;
}
sql("INSERT INTO `duck_mrs2016` (`transaction_id`,`creationdate`) VALUES " . implode(',', $sql_to_duck_mrs2016), $eo);
sql("INSERT INTO `membership_userrecords`(`tableName`, `pkValue`, `memberID`, `dateAdded`, `dateUpdated`, `groupID`) VALUES " . implode(',', $sql_to_membership_userrecords), $eo);
/* prepare list of duck IDs for email */
$data['duck_ids'] = implode(' - ', $duck_ids);
/* seller's full name */
$data['seller_full_name'] = $memberInfo['custom'][0];
/**
* send an email when a new transaction is placed.
**/
/* define associative array $mail_info to pass it to smtp_mail fn to send mail */
$mail_info = array('cc' => $memberInfo['email'], 'to' => $data['email'], 'message' => loadView('email-to-buyer', $data), 'subject' => "Badeendrace 2016");
/* send notification mail to seller and buyer */
smtp_mail($mail_info);
return TRUE;
}
示例7: get_site_url
<div class="stat-col">
<a href="<?php
echo get_site_url();
?>
">
<span class="label label-success label-soft">Массивы</span>
<span class="label label-success"><?php
echo $st->get_all_arrays();
?>
</span>
</a>
</div>
<?php
if (function_exists('loadView')) {
$data->class = "label-soft";
loadView('my', $data);
}
?>
<div class="stat-col">
<a href="/array-active">
<span class="label label-success
<?php
if (!is_page('array-active')) {
?>
label-soft<?php
}
?>
">Проходят</span>
<span class="label label-success"><?php
echo $st->active;
?>
示例8: loadView
} else {
if (strcmp($_POST['member']['password'], $_POST['member']['password_confirmation']) !== 0) {
$errors[] = 'Password confirmation does not matched with Password';
}
}
if (count($errors) > 0) {
$data['member'] = $_POST['member'];
$data['errors'] = $errors;
loadView('_signup_form.php', $data);
} else {
$u = new User();
$u->isActive = false;
$u->email = $_POST['member']['email'];
$u->firstName = $_POST['member']['first_name'];
$u->lastName = $_POST['member']['last_name'];
$u->password = $_POST['member']['password'];
$result = $u->save();
if ($result) {
$result->sendActivationEmail();
Session::putFlash(['success' => "Sign-up successful. An email is sent to you to activate your account before you can sign-in"]);
redirect("/session.php");
} else {
$data['member'] = $_POST['member'];
$data['errors'] = ['Something went wrong'];
loadView('_signup_form.php', $data);
}
}
} else {
loadView('_signup_form.php');
}
}
示例9: render
/**
* Enter description here...
*
* @param unknown_type $action
* @param unknown_type $layout
* @param unknown_type $file
* @return unknown
*/
function render($action = null, $layout = null, $file = null)
{
$viewClass = $this->view;
if ($this->view != 'View') {
$viewClass = $this->view . 'View';
loadView($this->view);
}
$this->beforeRender();
$ctrl =& $this->controller;
$ctrl->layout = $this->layout;
$ctrl->viewPath = Inflector::underscore($this->name);
$ctrl->set($this->data);
$this->_viewClass =& new $viewClass($ctrl);
return $this->_viewClass->render($action, $layout, $action . '.text.plain');
}
示例10: foreach
<div class="entry-content all-users">
<?php
// User Loop
if (!empty($user_query->results)) {
foreach ($user_query->results as $user) {
get_template_part('content', 'peoples');
}
} else {
echo 'No users found.';
}
?>
</div>
<?php
if (function_exists('loadView')) {
loadView('my-taxonomies', $data);
}
?>
</header>
</article>
<?php
// grab the current query parameters
$query_string = $_SERVER['QUERY_STRING'];
// The $base variable stores the complete URL to our page, including the current page arg
// if in the admin, your base should be the admin URL + your page
// $base = 'http://5.178.82.26/lyudi/' . remove_query_arg('p', $query_string) . '%_%';
$paginate_url = home_url() . "/people/page/";
// if on the front end, your base is the current page
//$base = get_permalink( get_the_ID() ) . '?' . remove_query_arg('p', $query_string) . '%_%';
$page_args = array('base' => str_replace($big = 999999999, '%#%', $paginate_url . $big), 'format' => '&p=%#%', 'prev_text' => __('« Previous'), 'next_text' => __('Next »'), 'total' => $total_pages, 'current' => $page, 'end_size' => 1, 'mid_size' => 5);
?>
示例11: diductio_subsriber_options
function diductio_subsriber_options()
{
$data = new stdClass();
$data->test = 'test';
loadView('subscriber-options', $data);
}
示例12: htmlspecialchars
//Cargar las vistas o templates dependiendo del userLogged -->
if (!$G->user->isLogged()) {
// Gestionar los errores del formulario de login -->
$G->error = "ok";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!empty($_POST['user']) && !empty($_POST['pass'])) {
// Recoger los datos del form -->
$user = htmlspecialchars(trim($_POST['user']));
$password = htmlspecialchars(trim($_POST['pass']));
$password_hashed = hash("sha256", $password);
//Existe el usuario?
if ($existData = $G->user->exists(0, $user)) {
if ($existData["u_password"] == $password_hashed) {
$G->user->loadData($existData);
$insert_query = $G->db->prepare("UPDATE " . DB_PREFIX . "usuarios set u_sesion=1 WHERE u_id=" . $_SESSION["id"] . " AND u_nick='" . $_SESSION["user"] . "'");
$insert_query->execute();
redirectTo("home");
} else {
$G->error = "La contraseña ingresa es incorrecta.";
}
} else {
$G->error = "El usuario al que intenta acceder no existe!";
}
} else {
$G->error = "Debe completar todos los campos.";
}
}
loadView("login.phtml");
} else {
redirectTo("home");
}
示例13: render
/**
* Gets an instance of the view object and prepares it for rendering the output, then
* asks the view to actualy do the job.
*
* @param string $action
* @param string $layout
* @param string $file
* @return controllers related views
* @access public
*/
function render($action = null, $layout = null, $file = null)
{
$viewClass = $this->view;
if ($this->view != 'View') {
$viewClass = $this->view . 'View';
loadView($this->view);
}
$this->beforeRender();
$this->__viewClass =& new $viewClass($this);
if (!empty($this->modelNames)) {
foreach ($this->modelNames as $model) {
if (!empty($this->{$model}->validationErrors)) {
$this->__viewClass->validationErrors[$model] =& $this->{$model}->validationErrors;
}
}
}
$this->autoRender = false;
return $this->__viewClass->render($action, $layout, $file);
}
示例14: redirectTo
* Time: 11:06
*/
if (!$G->user->isLogged()) {
redirectTo("login");
} else {
$G->error = "ok";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!empty($_POST["matricula"])) {
$matricula = !empty($_POST["matricula"]) ? trim($_POST["matricula"]) : ($G->error .= "Falta matricula.<br/>");
$modelo = !empty($_POST["modelo"]) ? trim($_POST["modelo"]) : ($G->error .= "Falta modelo.<br/>");
$tipo = !empty($_POST["tipo"]) ? trim($_POST["tipo"]) : ($G->error .= "Falta tipo.<br/>");
$potencia = !empty($_POST["potencia"]) ? trim($_POST["potencia"]) : ($G->error .= "Falta potencia.<br/>");
//$camionero = !empty($_POST["camionero"]) ? trim($_POST["camionero"]) : ($G->error .= "Falta cedula del camionero.<br/>");
if ($G->error == "ok") {
$insert_query = $G->db->prepare("INSERT INTO " . DB_PREFIX . "camiones (c_matricula, c_modelo, c_tipo, c_potencia)\n VALUES (?, ?, ?, ?)");
$insert_query->execute(array($matricula, $modelo, $tipo, $potencia));
}
}
}
//Cargar los registros -->
$query = $G->db->prepare("SELECT * FROM " . DB_PREFIX . "camiones ORDER BY cid ASC");
$query->execute();
//Existen registros?
if ($query->rowCount()) {
$G->camiones = $query->fetchAll();
} else {
$G->camiones = null;
}
$G->act = isset($_GET["act"]) ? trim($_GET["act"]) : "registros";
loadView('logged/camiones.phtml');
}
示例15: loadView
<?php
/**
* Created by PhpStorm.
* User: Pavel
* Date: 2015-11-06
* Time: 8:09 PM
*/
?>
<?php
echo loadView('navbar');
echo loadView('homepage/jumbotron');
echo loadView('homepage/recents');