本文整理汇总了PHP中Media::getCSSPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Media::getCSSPath方法的具体用法?PHP Media::getCSSPath怎么用?PHP Media::getCSSPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Media
的用法示例。
在下文中一共展示了Media::getCSSPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeCSS
public function removeCSS($css_uri, $css_media_type = 'all')
{
if (!is_array($css_uri)) {
$css_uri = array($css_uri);
}
foreach ($css_uri as $css_file => $media) {
if (is_string($css_file) && strlen($css_file) > 1) {
$css_path = Media::getCSSPath($css_file, $media);
} else {
$css_path = Media::getCSSPath($media, $css_media_type);
}
if ($css_path && isset($this->css_files[key($css_path)]) && $this->css_files[key($css_path)] == reset($css_path)) {
unset($this->css_files[key($css_path)]);
}
}
}
示例2: addCSS
/**
* Add a new stylesheet in page header.
*
* @param mixed $css_uri Path to css file, or list of css files like this : array(array(uri => media_type), ...)
* @param string $css_media_type
* @return true
*/
public function addCSS($css_uri, $css_media_type = 'all')
{
if (is_array($css_uri)) {
foreach ($css_uri as $css_file => $media) {
if (is_string($css_file) && strlen($css_file) > 1) {
$css_path = Media::getCSSPath($css_file, $media);
if ($css_path && !in_array($css_path, $this->css_files)) {
$this->css_files = array_merge($this->css_files, $css_path);
}
} else {
$css_path = Media::getCSSPath($media, $css_media_type);
if ($css_path && !in_array($css_path, $this->css_files)) {
$this->css_files = array_merge($this->css_files, $css_path);
}
}
}
} else {
if (is_string($css_uri) && strlen($css_uri) > 1) {
$css_path = Media::getCSSPath($css_uri, $css_media_type);
if ($css_path) {
$this->css_files = array_merge($this->css_files, $css_path);
}
}
}
}
示例3: getJqueryPluginCSSPath
/**
* return jquery plugin css path if exist.
*
* @param mixed $name
* @return string|boolean
*/
public static function getJqueryPluginCSSPath($name, $folder = null)
{
if ($folder === null) {
$folder = _PS_JS_DIR_ . 'jquery/plugins/';
}
//set default folder
$file = 'jquery.' . $name . '.css';
$url_data = parse_url($folder);
$file_uri = _PS_ROOT_DIR_ . Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
$file_uri_host_mode = _PS_CORE_DIR_ . Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
if (@file_exists($file_uri . $file) || defined('_PS_HOST_MODE_') && @file_exists($file_uri_host_mode . $file)) {
return Media::getCSSPath($folder . $file);
} elseif (@file_exists($file_uri . $name . '/' . $file) || defined('_PS_HOST_MODE_') && @file_exists($file_uri_host_mode . $name . '/' . $file)) {
return Media::getCSSPath($folder . $name . '/' . $file);
} else {
return false;
}
}
示例4: getJqueryPluginCSSPath
/**
* return jquery plugin css path if exist.
*
* @param mixed $name
* @return void
*/
public static function getJqueryPluginCSSPath($name)
{
$folder = _PS_JS_DIR_ . 'jquery/plugins/';
$file = 'jquery.' . $name . '.css';
$url_data = parse_url($folder);
$file_uri = _PS_ROOT_DIR_ . Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
if (@filemtime($file_uri . $file)) {
return Media::getCSSPath($folder . $file);
} elseif (@filemtime($file_uri . $name . '/' . $file)) {
return Media::getCSSPath($folder . $name . '/' . $file);
} else {
return false;
}
}