本文整理汇总了PHP中iPHP::PG方法的典型用法代码示例。如果您正苦于以下问题:PHP iPHP::PG方法的具体用法?PHP iPHP::PG怎么用?PHP iPHP::PG使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iPHP
的用法示例。
在下文中一共展示了iPHP::PG方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: multiple_device
/**
* 多终端适配
* @param [type] &$config [系统配置]
* @return [type] [description]
*/
private static function multiple_device(&$config)
{
$template = $config['template'];
$_device = iPHP::PG('device');
if ($_device) {
/**
* 判断指定设备
* @var [type]
*/
foreach ((array) $template['device'] as $key => $device) {
if ($device['tpl'] && ($device['ua'] == $_device || $device['name'] == $_device)) {
$device_name = $device['name'];
$device_tpl = $device['tpl'];
$domain = $device['domain'];
break;
}
}
}
/**
* 无指定设备 判断USER_AGENT
*/
if (empty($device_tpl)) {
foreach ((array) $template['device'] as $key => $device) {
if ($device['tpl'] && self::device_agent($device['ua'])) {
$device_name = $device['name'];
$device_tpl = $device['tpl'];
$domain = $device['domain'];
break;
}
}
}
iPHP::$mobile = false;
if ($device_tpl) {
//设备模板
$def_tpl = $device_tpl;
} else {
//检查是否移动设备
if (self::device_agent($template['mobile']['agent'])) {
iPHP::$mobile = true;
$mobile_tpl = $template['mobile']['tpl'];
$device_name = 'mobile';
$def_tpl = $mobile_tpl;
$domain = $template['mobile']['domain'];
}
}
if (empty($def_tpl)) {
$device_name = 'desktop';
$def_tpl = $template['desktop']['tpl'];
$domain = false;
}
define('iPHP_ROUTER_URL', $config['router']['URL']);
$domain && ($config['router'] = str_replace($config['router']['URL'], $domain, $config['router']));
define('iPHP_DEFAULT_TPL', $def_tpl);
define('iPHP_MOBILE_TPL', $mobile_tpl);
define('iPHP_DEVICE', $device_name);
define('iPHP_HOST', $config['router']['URL']);
header("Access-Control-Allow-Origin: " . iPHP_HOST);
header('Access-Control-Allow-Headers: X-Requested-With,X_Requested_With');
}
示例2: defined
* @licence http://www.idreamsoft.com/license.php
* @version 6.0.0
* @$Id: admincp.class.php 2361 2014-02-22 01:52:39Z coolmoo $
*/
defined('iPHP') or exit('What are you doing?');
iDB::$show_errors = true;
iPHP::$dialog['title'] = 'iCMS';
define('iCMS_SUPERADMIN_UID', '1');
define('__ADMINCP__', __SELF__ . '?app');
define('ACP_PATH', iPHP_APP_DIR . '/admincp');
define('ACP_HOST', "http://" . $_SERVER['HTTP_HOST']);
require iPHP_APP_CORE . '/iMenu.class.php';
require iPHP_APP_CORE . '/iMember.class.php';
iMember::$LOGIN_TPL = ACP_PATH;
iMember::$AUTH = 'ADMIN_AUTH';
iMember::$AJAX = iPHP::PG('ajax');
$_GET['do'] == 'seccode' && iACP::get_seccode();
class iACP
{
public static $apps = NULL;
public static $frames = NULL;
public static $menu = NULL;
public static $app = NULL;
public static $app_name = NULL;
public static $app_do = NULL;
public static $app_args = NULL;
public static $app_method = NULL;
public static $app_tpl = NULL;
public static $app_path = NULL;
public static $app_file = NULL;
public static function init()