本文整理汇总了PHP中Globals::set_var方法的典型用法代码示例。如果您正苦于以下问题:PHP Globals::set_var方法的具体用法?PHP Globals::set_var怎么用?PHP Globals::set_var使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Globals
的用法示例。
在下文中一共展示了Globals::set_var方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: raise404
<?php
namespace Iekadou\Webapp;
require_once "../../inc/include.php";
if (Account::is_logged_in() != true) {
raise404();
die;
}
new View('Activate', Translation::translate('Activate'), 'account/activate.html');
Globals::set_var('dashboard_active', true);
View::render();
示例2: Image
<?php
namespace Iekadou\Webapp;
require_once "../inc/include.php";
$Image = new Image();
$id = isset($_GET['id']) ? htmlspecialchars($_GET['id']) : false;
$Image = $Image->get_by(array(array("id", "=", $id), array("userid", "=", Account::get_user_id())));
if ($Image == false) {
raise404();
die;
}
new View('Image', Translation::translate('Image'), "image.html");
Globals::set_var('Image', $Image);
View::render();
示例3: define
define('REQUEST_METHOD', "GET");
}
session_start();
define('PATH', $_SERVER['DOCUMENT_ROOT'] . '/');
define('Lare', true);
// configs
include PATH . "config/webapp.php";
// includes
require_once PATH . "vendor/autoload.php";
require_once PATH . "classes/Globals.php";
include PATH . "inc/utils.php";
require_once PATH . "classes/Translation.php";
require_once PATH . "classes/View.php";
require_once PATH . "classes/UrlsPy.php";
require_once PATH . "classes/Pagination.php";
require_once PATH . "classes/TwigUrl.php";
require_once PATH . "classes/TwigTrans.php";
require_once PATH . "classes/TwigTime.php";
require_once PATH . "classes/View.php";
require_once PATH . "classes/DBConnector.php";
require_once PATH . "classes/BaseModel.php";
require_once PATH . "classes/User.php";
require_once PATH . "classes/Image.php";
require_once PATH . "classes/Files.php";
require_once PATH . "classes/ValidationError.php";
require_once PATH . "classes/Migration.php";
require_once PATH . "classes/Account.php";
Globals::set_var('Account', new Account());
Globals::set_var('SITE_NAME', SITE_NAME);
Globals::set_var('DOMAIN', DOMAIN);
$INIT_LOADED = true;
示例4: View
<?php
namespace Iekadou\Webapp;
require_once "../inc/include.php";
new View('Login', Translation::translate('Login'), "login.html");
$referrer = isset($_GET['referrer']) ? htmlspecialchars($_GET['referrer']) : false;
Globals::set_var('referrer', $referrer);
View::render();