本文整理汇总了PHP中controller::getView方法的典型用法代码示例。如果您正苦于以下问题:PHP controller::getView方法的具体用法?PHP controller::getView怎么用?PHP controller::getView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类controller
的用法示例。
在下文中一共展示了controller::getView方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
global $application;
if (!isset($_SESSION['master_email'])) {
$application->direct('index', false);
}
$view = parent::getView();
$view->set('general->imgkey', rand(1, 7));
$email = $_SESSION['master_email'];
$sec_key = $_SESSION['sec_key'];
$application->database->prepare('SELECT id, look, username, credits, motto FROM server_users WHERE email = ?', array($email));
$characters = $application->database->execute();
$widget = ' ';
while ($c = $characters->to_array()) {
$w = new widget_object('character-widget');
$w->set('character->look', $c['look']);
$w->set('character->motto', $c['motto']);
$w->set('character->username', $c['username']);
$w->set('character->credits', $c['credits']);
$w->set('character->string', base64_encode(sha1($c['id'])));
$widget = $widget . $w->execute();
}
if (strlen($widget) <= 10) {
$widget = 'No Characters<br><br>';
}
$view->set('user->email', $email);
$view->set('user->seckey', $sec_key);
$view->set('user->characters', $widget);
$view->execute();
}
示例2: execute
public function execute()
{
global $application;
if (isset($_GET['user'])) {
$view = parent::getView();
$application->database->prepare('SELECT id FROM server_users WHERE username = ?', array($_GET['user']));
$id = $application->database->execute()->result;
$key = generate_ticket(array($id, $_GET['user']));
$application->database->prepare('UPDATE server_users SET client_key = ? WHERE id = ?', array($key, $id));
$application->database->execute();
$view->set('user->sso', $key);
$view->set('rand->number', rand(0, 999));
$view->execute();
} else {
if (!isset($_SESSION['master_email'])) {
$application->direct('index', false);
exit;
} else {
if (!isset($_SESSION['habbo']['id'])) {
$application->direct('characters', false);
exit;
}
}
$view = parent::getView();
$key = generate_ticket(array($application->user->id, $application->user->username));
$application->user->set_sso($key);
$view->set('user->sso', $key);
$view->set('rand->number', rand(0, 999));
$view->execute();
}
}
示例3: execute
public function execute()
{
global $application;
if (isset($_SESSION['master_email'])) {
if (isset($_SESSION['habbo']['id'])) {
$application->direct('me', false);
} else {
$application->direct('characters', false);
}
exit;
}
parent::getView()->set('general->imgkey', rand(1, 7));
parent::getView()->execute();
}
示例4: execute
public function execute()
{
global $application;
if (!isset($_SESSION['master_email'])) {
$application->direct('index', false);
exit;
} else {
if (!isset($_SESSION['habbo']['id'])) {
$application->direct('characters', false);
exit;
}
}
$view = parent::getView();
$view->set('general->imgkey', rand(1, 7));
$view->set('user->seckey', $_SESSION['sec_key']);
$view->set('user->username', $application->user->username);
$view->set('user->motto', $application->user->motto);
$view->set('user->credits', $application->user->credits);
$view->set('user->look', $application->user->look);
if (count($application->user->badges) == 0) {
$view->set('user->badges', 'No Badges, why don\'t you earn some?');
} else {
$badges = '';
foreach ($application->user->badges as $b) {
$badges .= '<img src="http://habboo-a.akamaihd.net/c_images/album1584/' . $b . '.gif" rel="tooltip" title="' . $b . '" style="margin-right: 28px;"/>';
}
$view->set('user->badges', $badges);
}
/*
TODO: Clean this up? :/
*/
$application->database->prepare('SELECT id, username, look FROM server_users WHERE email = ? AND id <> ?', array($_SESSION['master_email'], $application->user->id));
$characters = $application->database->execute();
$z = '';
while ($c = $characters->to_array()) {
$w = new widget_object('mini-character-widget');
$w->set('character->username', $c['username']);
$w->set('character->look', $c['look']);
$w->set('character->string', base64_encode(sha1($c['id'])));
$z .= $w->execute();
}
if ($characters->num_rows == 0) {
$z = 'No Other Characters, Why dont you create some more?';
}
$view->set('user->characters', $z);
$view->execute();
}
示例5: execute
public function execute()
{
global $application;
$view = parent::getView();
$view->set('general->imgkey', rand(1, 7));
switch ($_GET['reason']) {
case 'error':
$view->set('error->title', 'Packet Error');
$view->set('error->info', 'Usually a packet error occurs when you encountered a event in the client that the emulator didn\'t respond to. This usually means it hasn\'t been coded yet. It isn\'t your fault!');
break;
case 'connection_failed':
$view->set('error->title', 'Cannot Connect');
$view->set('error->info', 'This error means that something is blocking the port or the server just isn\'t online! Do not fret, the server will be back on soon!');
break;
}
foreach ($_POST as $key => $value) {
$view->set('error->' . $key, $value);
}
$view->execute();
}
示例6: define
if (phpversion() < 5.3) {
define('__DIR__', dirname(__FILE__));
}
$path = get_include_path() . PATH_SEPARATOR . __DIR__ . '/' . implode(PATH_SEPARATOR . __DIR__ . '/', $path);
set_include_path($path);
require_once 'class.page.php';
require_once 'class.controller.php';
require_once 'class.invis.db.php';
require_once 'uservar.php';
include_once "class.product.php";
$page = Page::getInstance();
$page->setDoctype(Page::$XHTML);
$controller = new controller();
$controller->setDelimiter('activate');
$db = db::getInstance();
$controller->getView();
if ($controller->getController() == 'admin') {
$controller->getView('admin');
$admin = 'views/admin/';
} else {
$admin = 'views/';
}
$root = $_SERVER['DOCUMENT_ROOT'];
if (is_file($controller->view)) {
if ($controller->getController() == 'admin' and $controller->view != 'views/admin/adminIn.phtml' and $controller->view != 'views/admin/adminLogin.phtml') {
require_once "include.php";
require_once "lock.php";
}
if ($controller->view == "views/admin/adminIndex.phtml") {
header('Location: /admin/firm');
}
示例7: array
/** добавляем папки в include_path */
$path = array('lib');
if (phpversion()<5.3){
define('__DIR__',dirname(__FILE__));
}
$path = get_include_path().PATH_SEPARATOR.__DIR__.'/'.implode(PATH_SEPARATOR.__DIR__.'/',$path);
set_include_path($path);
require_once 'class.page.php';
require_once 'class.controller.php';
require_once 'class.invis.db.php';
$page = Page :: getInstance();
$page -> setDoctype(Page :: $XHTML);
$page -> addMetric("metrics/yandex.inc","metrics/google.inc");
$controller = new controller();
$db=db :: getInstance();
$db2=db :: getInstance();
$controller -> getView();
if (is_file($controller -> view)){
require_once 'views/_header.phtml';
require_once($controller -> view);
require_once 'views/_footer.phtml';
} else {
header("HTTP/1.1 404 Not Found");
require_once 'views/_header.phtml';
require_once "views/404.phtml";
require_once 'views/_footer.phtml';
}
?>