本文整理汇总了PHP中request::getCfg方法的典型用法代码示例。如果您正苦于以下问题:PHP request::getCfg方法的具体用法?PHP request::getCfg怎么用?PHP request::getCfg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类request
的用法示例。
在下文中一共展示了request::getCfg方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uploadedUri
/**
* Make a valid URI for an uploaded File
*
* @param string $file The filepath
* @param array $prm Array to overwritte default uri construction
* @return string The valid URI
*/
public static function uploadedUri($file, array $prm = array()) {
return self::uri(array_merge(array(
'lang'=>false,
'module'=>'nyroUtils',
'action'=>'uploadedFiles',
'param'=>str_replace(array('/', '\\'), array(request::getCfg('sepParam'), request::getCfg('sepParam')), $file),
'out'=>false
), $prm));
}
示例2: getUrlFile
/**
* Get an URL for a CSS or JS file.
*
* @param string $type (css|js)
* @param array|string $files List of files or a single file path
* @param string $dir Where to get the file (nyro|web)
* @return string
*/
public function getUrlFile($type, $files, $dir = 'nyro') {
$prm = $this->cfg->get($type);
$url = $dir == 'web'
? request::get('path').$prm['dirWeb']
: request::getPathControllerUri().$prm['dirUriNyro'];
if (request::isAbsolutizeAllUris())
$url = request::get('domain').$url;
$url.= '/'.(is_array($files)? implode(request::getCfg('sepParam'), $files) : $files);
$url.= '.'.$prm['ext'];
return $url;
}
示例3: getIcon
/**
* Get an icon
*
* @param array $prm Icon configuration. Available key:
* - string name: action name (required)
* - string type: icon type
* - bool imgTag: true if the return should be a valid html img tag. if false, will return he url
* - string alt: alt text for the image, used only if imgTag = true
* - array attr: attributes added to the img tag
* @return unknown
*/
public static function getIcon(array $prm) {
$ret = null;
static $cfg;
if (!$cfg)
$cfg = factory::loadCfg('icons', false);
if (config::initTab($prm, array(
'name'=>null,
'type'=>$cfg['default'],
'imgTag'=>true,
'alt'=>'',
'attr'=>array(),
))) {
if (array_key_exists($prm['type'], $cfg['icons'])
&& is_array($cfg['icons'][$prm['type']])
&& in_array($prm['name'], $cfg['icons'][$prm['type']])) {
$ret = request::get('path').$cfg['dir'].'/'.$prm['type'].request::getCfg('sepParam').$prm['name'].$cfg['ext'];
} else if ($prm['type'] != $cfg['default']) {
$ret = self::getIcon(array('name'=>$prm['name'], 'imgTag'=>false));
}
if ($ret && $prm['imgTag']) {
$alt = $prm['alt']? $prm['alt'] : ucFirst($prm['name']);
$ret = self::htmlTag('img', array_merge(array(
'src'=>$ret,
'alt'=>$alt
), $prm['attr']));
}
}
return $ret;
}