本文整理汇总了PHP中IUrl::getInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP IUrl::getInfo方法的具体用法?PHP IUrl::getInfo怎么用?PHP IUrl::getInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUrl
的用法示例。
在下文中一共展示了IUrl::getInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createController
/**
* @brief 创建当前的Controller对象
* @return object Controller对象
*/
public function createController()
{
$controller = IUrl::getInfo("controller");
if ($controller === null) {
$controller = $this->defaultController;
}
if (class_exists($controller)) {
$controllerClass = new $controller($this, $controller);
} else {
$controllerClass = new IController($this, $controller);
}
$this->controller = $controllerClass;
return $controllerClass;
}
示例2: createController
/**
* @brief 创建当前的Controller对象
* @return object Controller对象
*/
public function createController()
{
$ctrlId = IUrl::getInfo("controller");
if ($ctrlId == '') {
$ctrlId = $this->defaultController;
}
if (class_exists($ctrlId)) {
$ctrlObject = new $ctrlId($this, $ctrlId);
} else {
$ctrlObject = new IController($this, $ctrlId);
}
$this->controller = $ctrlObject;
return $this->controller;
}
示例3: createAction
/**
* @brief 创建action动作
* @return object 返回action动作对象
*/
public function createAction()
{
//获取action的标识符
$actionId = IUrl::getInfo('action');
//设置默认的action动作
if ($actionId == '') {
$actionId = $this->defaultAction;
}
/*创建action对象流程
*1,控制器内部动作
*2,配置动作
*3,视图动作*/
//1,控制器内部动作
if (method_exists($this, $actionId)) {
$this->action = new IInlineAction($this, $actionId);
} else {
if (($actions = $this->actions()) && isset($actions[$actionId])) {
//自定义类名
$className = $actions[$actionId]['class'];
$this->action = new $className($this, $actionId);
} else {
$this->action = new IViewAction($this, $actionId);
}
}
return $this->action;
}
示例4: run
public function run($setindex = '')
{
IUrl::beginUrl();
$controller = IUrl::getInfo('controller');
$action = IUrl::getInfo('action');
$Taction = empty($action) ? $this->defaultAction : $action;
$info = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '');
$sitekey = isset($this->config['sitekey']) ? $this->config['sitekey'] : '';
//if ($this->getkey() != $sitekey) {
// echo 'error! 关注好资源222-www.mx800.com';
// exit();
//}
/*
$hostcheck = array('wmr.xiaoshuhaochi.com', 'wmr.xiaoshuhaochi.com', 'xiaoshuhaochi.com');
if (!in_array($info, $hostcheck)) {
echo 'error! 关注好资源111-www.mx800.com';
exit();
}*/
if ($controller === NULL) {
$controller = $this->defaultController;
}
$this->controller = $controller;
$this->Taction = $Taction;
if ($controller == 'site' && $Taction == 'index') {
if (is_mobile_request()) {
$this->controller = 'html5';
}
}
spl_autoload_register('Mysite::autoload');
$filePath = hopedir . '/lib/Smarty/libs/Smarty.class.php';
if (!class_exists('smarty')) {
include_once $filePath;
}
if ($controller == 'adminpage') {
$smarty = new Smarty();
$smarty->assign('siteurl', Mysite::$app->config['siteurl']);
$smarty->cache_lifetime = 0;
$smarty->caching = false;
$smarty->template_dir = hopedir . '/templates/';
$smarty->compile_dir = hopedir . '/templates_c/adminpage';
$smarty->cache_dir = hopedir . '/smarty_cache';
$smarty->left_delimiter = '<{';
$smarty->right_delimiter = '}>';
$module = IUrl::getInfo('module');
$module = empty($module) ? 'index' : $module;
$doaction = Mysite::$app->getAction() == 'index' ? 'system' : Mysite::$app->getAction();
$this->Taction = $doaction;
$this->siteset();
if (!file_exists(hopedir . '/module/' . Mysite::$app->getAction() . '/adminmethod.php')) {
} else {
include hopedir . '/module/' . Mysite::$app->getAction() . '/adminmethod.php';
$method = new method();
$method->init();
if (method_exists($method, $module)) {
call_user_func(array($method, $module));
}
}
$datas = $this->getdata();
if (is_array($datas)) {
foreach ($datas as $key => $value) {
$smarty->assign($key, $value);
}
}
$nowID = ICookie::get('myaddress');
$lng = ICookie::get('lng');
$lat = ICookie::get('lat');
$mapname = ICookie::get('mapname');
$adminshopid = ICookie::get('adminshopid');
$smarty->assign('myaddress', $nowID);
$smarty->assign('mapname', $mapname);
$smarty->assign('adminshopid', $adminshopid);
$smarty->assign('lng', $lng);
$smarty->assign('lat', $lat);
$smarty->assign('controlname', Mysite::$app->getController());
$smarty->assign('Taction', Mysite::$app->getAction());
$smarty->assign('urlshort', Mysite::$app->getController() . '/' . Mysite::$app->getAction());
$templtepach = hopedir . '/templates/adminpage/' . Mysite::$app->getAction() . '/' . $module . '.html';
if (file_exists($templtepach)) {
} else {
if (file_exists(hopedir . '/module/' . Mysite::$app->getAction() . '/adminpage/' . $module . '.html')) {
$smarty->compile_dir = hopedir . '/templates_c/adminpage/' . Mysite::$app->getAction();
$templtepach = hopedir . '/module/' . Mysite::$app->getAction() . '/adminpage/' . $module . '.html';
} else {
logwrite('模板不存在 ');
$smarty->assign('msg', '模板文件不存在');
$smarty->assign('sitetitle', '错误提示');
$errorlink = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$smarty->assign('errorlink', $errorlink);
$templtepach = hopedir . '/templates/adminpage/public/error.html';
}
}
$smarty->assign('tmodule', $module);
$smarty->assign('tempdir', 'adminpage');
$smarty->registerPlugin('function', 'ofunc', 'FUNC_function');
$smarty->registerPlugin('block', 'oblock', 'FUNC_block');
$smarty->display($templtepach);
exit;
} else {
$smarty = new Smarty();
//.........这里部分代码省略.........