本文整理汇总了PHP中core::moduleName方法的典型用法代码示例。如果您正苦于以下问题:PHP core::moduleName方法的具体用法?PHP core::moduleName怎么用?PHP core::moduleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core
的用法示例。
在下文中一共展示了core::moduleName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
$args= func_get_args();
while (is_array($args[0])) $args= $args[0];
//debug::dump($args);
reset($args);
if (key($args)===0)
{
if (count($args)%2)
{
$this->module= $args[0];
unset($args[0]);
}
else $this->module= core::moduleName();
while(current($args)!==false)
{
$name= current($args);
$val= next($args);
if ($name=='#') $this->anchor= $val;
elseif ($val==null) unset($this->args[$name]);
else $this->args[$name]= $val;
next($args);
}
}
else $this->args= $args;
}
示例2: processArgs
static function processArgs($args)
{
if (is_array($args[0])) return $args[0]; // already processed
$args_processed= array('module'=>core::moduleName(),'request'=>array());
if ($args[0]) $args_processed['module']= $args[0];
else $args_processed['current']= true;
if (count($args)>1)
{
unset($args[0]);
$args_processed['request']= href::chain2pairs($args);
}
return $args_processed;
}
示例3: label
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<?php
echo core::prepend('head');
?>
</head>
<body>
<?
$c= cms::context();
$c-> label('Test if data files writable') -> icon('offline_pin') -> popup(core::url('test-files'));
$c-> label('To ConKit project page') -> icon('cloud') -> url("https://github.com/stanpro/conkit");
echo cms::anchorGlobal($c);
?>
<fieldset>
<legend>Header (see head.tpl.php)</legend>
<div>
<img src="logo.png" style="width:100px; vertical-align:middle; margin-right:2em; margin-left:3em;">
<a href="<?php
echo cms::loginUrl();
?>
">Login</a>
</div>
</fieldset>
<fieldset style="padding:3em;">
<legend>Body template (see <?php
echo core::moduleName();
?>
.tpl.php)</legend>
示例4: start
static function start() /// Launches whole the action after configuration read
{
error_reporting(core::$config['error-reporting-lo']);
foreach ($_COOKIE as $var=>$val) core::$req[$var]= $val;
if (isset(core::$config['cookie-vars'])) foreach (core::$config['cookie-vars'] as $var=>$config)
{
core::$req[$var]= core::filter(core::req($var),$config);
}
foreach ($_GET as $var=>$val) if ($var!==session_name()) core::$req[$var]= core::$reqUrl[$var]= $val;
unset(core::$reqUrl[core::config('module-var')]);
foreach ($_POST as $var=>$val) if ($var!==session_name()) core::$req[$var]= $val;
foreach ($_FILES as $var=>$val)
{
if (is_string($val['name'])) core::$req[$var]= $val; // <input type=file name=xxx ...>
else // <input type=file name=xxx[yyy] ...>
{
foreach ($val['name'] as $key=>$void)
{
core::$req[$var][$key]= array(
'name'=>$val['name'][$key],
'type'=>$val['type'][$key],
'tmp_name'=>$val['tmp_name'][$key],
'error'=>$val['error'][$key],
'size'=>$val['size'][$key]
);
}
}
}
if (isset(core::$config['cookie-vars'])) foreach (core::$config['cookie-vars'] as $name=>$config)
{
if (isset(core::$req[$name]))
{
core::$req[$name]= core::filter(core::$req[$name], $config);
if (!isset($_COOKIE[$name]) || $_COOKIE[$name]!=core::$req[$name])
{
setcookie($name, core::$req[$name], $config['expire']);
}
unset(core::$reqUrl[$name]);
}
}
// apply required vars
if (isset(core::$config['required'])) foreach (core::$config['required'] as $name=>$config)
{
core::$req[$name]= core::filter(core::$req[$name],$comfig);
core::$reqUrl[$name]= core::$req[$name];
}
if (!core::moduleName())
{
if (is_array(core::$config['default-module']))
{
$args= href::processArgs(core::$config['default-module']);
core::$req[core::$config['module-var']]= $args['template'];
array_merge(core::$reques,$args['req']);
}
}
core::$req[core::$config['module-var']]= str_replace('..','(dot)(dot)',core::moduleName()); //secure upper directories
core::$req[core::$config['module-var']]= str_replace("\0",'(0)',core::moduleName()); //secure
core::$req[core::$config['module-var']]= str_replace('<','(lt)',core::moduleName()); //secure
core::$req[core::$config['module-var']]= str_replace('>','(gt)',core::moduleName()); //secure
// set session var
if (core::req(session_name()) || isset(core::$config['session-vars']))
{
if (!session_id()) session_start();
foreach ($_SESSION as $name=>$val) core::$req[$name]= $val;
if (isset(core::$config['session-vars'])) foreach (core::$config['session-vars'] as $name=>$config)
{
core::$req[$name]= core::filter(core::req($name),$config);
unset(core::$reqUrl[$name]);
}
}
if (core::req('cms-oper')) cms::perform();
elseif (core::req('core-module')=='cms-resource') cmsGui::forward(core::req('file'));
ob_start();
if (isset(core::$config['pre-models'])) foreach(core::$config['pre-models'] as $model) core::model($model);
core::insert(core::moduleName());
$buffer= ob_get_contents();
ob_end_clean();
// Process pre- and post-templates
if (!core::reg('run-naked'))
{
ob_start();
if (isset(core::$config['pre-module'])) core::insert(core::$config['pre-module']);
echo $buffer;
if (isset(core::$config['post-module'])) core::insert(core::$config['post-module']);
if (isset(core::$config['post-models'])) foreach(core::$config['post-models'] as $model) core::model($model);
$buffer= ob_get_contents();
ob_end_clean();
}
// Output
echo $buffer;
//.........这里部分代码省略.........