本文整理汇总了PHP中Module::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::init方法的具体用法?PHP Module::init怎么用?PHP Module::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Module
的用法示例。
在下文中一共展示了Module::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
function init($request)
{
parent::init($request);
$ck = new Cookie(COOKIE_NAME_SESSION);
$ck->delete();
Request::redirectToModule('index');
}
示例2: init
public function init()
{
parent::init();
Yii::app()->params['forum_max_crumb_length'] = 40;
Yii::app()->params['forum_max_latest_reply_length'] = 30;
Yii::app()->params['forum_pageSize'] = 20;
}
示例3: run
public static function run()
{
if (!Site::init(!empty($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : '')) {
@header('HTTP/1.1 404 Not Found');
exit;
}
$method = Core::getRequestMethod();
if (!in_array($method, array('get', 'put', 'delete', 'post'))) {
@header("HTTP/1.1 501 Not Implemented");
exit;
}
$data = Core::getRequestData();
if (empty($data[$method]) && !in_array($_SERVER['REQUEST_URI'], array($_SERVER['SCRIPT_NAME'], "", "/"))) {
$data[$method] = $_SERVER['REQUEST_URI'];
}
$resource = Core::getResource($data, $method);
$staticFolders = array('/cache/', '/static/', '/uploads/', '/vendor/');
foreach ($staticFolders as $folder) {
if (strncasecmp($resource, $folder, strlen($folder)) === 0) {
@header('HTTP/1.1 404 Not Found');
exit;
}
}
App::set(App::parse($resource));
Core::resource($resource);
Module::init();
$response = Response\Factory::get($resource, $method);
if (empty($response)) {
@header('HTTP/1.1 406 Not Acceptable');
exit;
}
Request::init($response, $data);
echo Request::run($resource, $method);
}
示例4: init
/**
* initialize module with request datas
*
* @param object request
* @return void
*/
function init(&$request)
{
parent::init($request);
$this->tpl->caching = 0;
$this->tpl->mainTemplate = 'admin/structureAdmin.tpl';
if (isset($this->site)) {
$this->site->generateFiles();
}
// set mod to view because of specific elements in this case (period_selection.tpl)
$this->tpl->assign('mod', 'admin');
}
示例5: init
public function init()
{
parent::init();
//nested sets tree
$tree = $this->attachComponent('tree', new dbNestedSetsTree(TABLE_SITEMAP_TREE));
// //проверяем наличие корневого элемента
// if( $tree->checkRootNode( $nRootID ) )
// {
//если только-что создан, создаем и в "недеревянной" таблице
// $this->db->execute('INSERT INTO '.TABLE_SITEMAP.' (node_id, keyword, menu_title, created)
// VALUES('.$nRootID.', '.$this->db->str2sql('root').', '.$this->db->str2sql('Корневой раздел').', '.$this->db->getNOW().')');
// }
}
示例6: init
function init($request)
{
parent::init($request);
// if tpl is not allocated (which is the case for graphs)
// and if the login fails, there would be an error here trying to set a template with smarty not constructed
// so we simply display an error message and exit
if (!is_a($this->tpl, "TemplateEngine")) {
print "Error while authentificate, and TemplateEngine not constructed. <br>Exiting...<br>";
exit;
}
$this->tpl->caching = 0;
$this->tpl->setMainTemplate("common/login.tpl");
}
示例7: init
/**
* initialize module with request datas
*
* @param object request
* @return void
*/
function init(&$request, $o_tpl = null, $o_archive = null)
{
if (!is_a($o_tpl, "TemplateEngine")) {
$o_tpl = null;
}
parent::init($request, $o_tpl);
$date = $this->request->getDate();
if (is_null($this->data)) {
if (is_null($o_archive)) {
$o_archive = DataModel::getArchive($this->site, $date, $this->request->getPeriod());
}
$this->data = new DataModel($o_archive, $this->request);
}
$d = new Date(getDateFromTimestamp(time()));
if (($this->data->archive->date->get() == $d->get() || isset($this->disableCache)) && is_a($this->tpl, "TemplateEngine")) {
printDebug("Current date asked is today's date, cache not activated<br>");
$this->tpl->caching = 0;
}
}
示例8: init
public function init()
{
parent::init();
$this->items_images_path = bff::buildPath('items', 'images');
$this->items_images_url = bff::buildUrl('items', 'images');
# nested sets tree
$tree = $this->attachComponent('tree', new dbNestedSetsTree(TABLE_BBS_CATEGORIES));
bff::i()->GetModule('Services');
if (bff::$isFrontend) {
return;
}
# !
# проверяем наличие корневого элемента
if ($tree->checkRootNode($nRootID)) {
# если только-что создан, создаем категорию
$this->db->execute('UPDATE ' . TABLE_BBS_CATEGORIES . '
SET title = ' . $this->db->str2sql('Корневой раздел') . ', created = ' . $this->db->getNOW() . '
WHERE id = ' . $nRootID);
}
$this->initDynprops();
}
示例9: init
public function init()
{
parent::init();
// custom initialization code goes here
}
示例10: displayName
<?php
namespace ATPCore\Model;
class Module extends \ATP\ActiveRecord
{
public function displayName()
{
return $this->name;
}
public function getActiveModules()
{
return $this->loadMultiple("is_active = 1");
}
public function getActiveModuleNames()
{
$names = array();
foreach ($this->getActiveModules() as $module) {
$names[] = $module->name;
}
return $names;
}
}
Module::init();
示例11: init
public function init()
{
Yii::import('application.modules.formdesigner.models.*');
parent::init();
}
示例12: init
protected function init($page='', $args=array()) {
parent::init();
$moduleData = $this->getModuleData();
$this->moduleName = $moduleData['title'];
$this->setArgs($args);
$this->setPage($page);
$this->setTemplatePage($this->page, $this->id);
$this->pagetype = $GLOBALS['deviceClassifier']->getPagetype();
$this->platform = $GLOBALS['deviceClassifier']->getPlatform();
$this->supportsCerts = $GLOBALS['deviceClassifier']->getSupportsCerts();
$this->setAutoPhoneNumberDetection($GLOBALS['siteConfig']->getVar('AUTODETECT_PHONE_NUMBERS'));
// Pull in fontsize
if (isset($args['font'])) {
$this->fontsize = $args['font'];
setcookie('fontsize', $this->fontsize, time() + $this->getSiteVar('LAYOUT_COOKIE_LIFESPAN'), COOKIE_PATH);
} else if (isset($_COOKIE['fontsize'])) {
$this->fontsize = $_COOKIE['fontsize'];
}
switch ($this->pagetype) {
case 'compliant':
$this->imageExt = '.png';
break;
case 'touch':
case 'basic':
$this->imageExt = '.gif';
break;
}
}
示例13: init
public function init()
{
parent::init();
\Yii::configure($this, require __DIR__ . '/config.php');
}
示例14: init
function init()
{
global $MOD_TITLE, $MOD_GROUP, $MOD_VISIBLE, $MOD_SUBMENU;
parent::init($MOD_TITLE, $MOD_GROUP, $MOD_VISIBLE);
// получаем список лицевых счетов абонента
$this->accounts = array();
$this->urfa->call(-16469);
$this->urfa->send();
// получаем количество записей
$count = $this->urfa->get_int();
for ($i = 0; $i < $count; $i++) {
$aid = $this->urfa->get_int();
// номер лицевого счета
// пропускаем два неинтересных нам параметра
$this->urfa->get_double();
// денег на счету
$this->urfa->get_double();
// ??
// добавлем в списков лицевых счетов
$this->accounts[$aid] = $aid;
}
$this->urfa->finish();
if (isset($_REQUEST['Status'])) {
$status = $_REQUEST['Status'];
} else {
$status = '';
}
if ($status == 'pay') {
// получаем информацию о текущем пользователе
$this->user = array();
$this->urfa->call(-0x4052);
$this->urfa->send();
$this->user['id'] = $this->urfa->get_int();
$this->user['login'] = $this->urfa->get_string();
$this->user['basic_account'] = $this->urfa->get_int();
$this->user['balance'] = roundDouble($this->urfa->get_double());
$this->user['credit'] = roundDouble($this->urfa->get_double());
$this->user['is_blocked'] = resolveBlockState($this->urfa->get_int());
$this->user['create_date'] = getDateFromTimestamp($this->urfa->get_int());
$this->user['last_change_date'] = getDateFromTimestamp($this->urfa->get_int());
$this->user['who_create'] = resolveUserName($this->urfa->get_int());
$this->user['who_change'] = resolveUserName($this->urfa->get_int());
$this->user['is_juridical'] = $this->urfa->get_int();
$this->user['full_name'] = $this->urfa->get_string();
$accountId = intval($_REQUEST["AccountId"]);
// проверка введенного значения суммы оплаты
$subtotal_P = $_REQUEST['OutSum'];
$subtotal_P = trim($subtotal_P);
//убиарем лишние пробелы
$subtotal_P = str_replace(',', '.', $subtotal_P);
// заменяем запятые на точку
$subtotal_P = floatval($subtotal_P);
// пробуем преобразовать к числу
$subtotal_P = round($subtotal_P, 2);
// округляем до 2 знаков после запятой
if ($subtotal_P != 0 && $subtotal_P >= 10 && $subtotal_P < 10000) {
$client_ip = $_SERVER["REMOTE_ADDR"];
echo $client_ip . '<br \\>' . "\n";
$order_IDP = Uniteller::NewOrder($accountId, $subtotal_P, $client_ip);
echo $order_IDP . '<br \\>' . "\n";
//// Для отладки разрешаем переход на страницу оплаты только с определённого IP
//if ((strpos($client_ip, '10.79.124.') == 0)
// or (strpos($client_ip, '10.78.252.') == 0)) {
Uniteller::GoToPaymentPage($accountId, $order_IDP, $subtotal_P);
//}
} else {
// при некорректно введенной сумме платежа возвращаемся на эту же страницу
$url_return = $_SERVER['HTTP_REFERER'];
header('Location: ' . $url_return);
}
exit;
}
}
示例15: init
/**
* Initialize the request
*/
protected function init($command = '', $args = array())
{
parent::init();
$this->setArgs($args);
$this->setCommand($command);
}