本文整理汇总了PHP中gpOutput::CacheLess方法的典型用法代码示例。如果您正苦于以下问题:PHP gpOutput::CacheLess方法的具体用法?PHP gpOutput::CacheLess怎么用?PHP gpOutput::CacheLess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gpOutput
的用法示例。
在下文中一共展示了gpOutput::CacheLess方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: css
/**
* Add a css file to the page
* @since gpEasy 4.0
* @param string $file The path of the css file relative to the addon folder
* @param bool $combine Set to false to keep the file from being combined with other css files
*/
static function css($file, $combine = true)
{
global $page;
$file = common::WinPath($file);
if ($combine) {
$page->css_admin[] = self::$current['code_folder_part'] . '/' . ltrim($file, '/');
return self::$current['code_folder_part'] . '/' . ltrim($file, '/');
}
//less file
if (substr($file, -5) === '.less') {
$full_path = self::$current['code_folder_full'] . '/' . ltrim($file, '/');
$path = gpOutput::CacheLess($full_path);
} else {
$path = self::$current['code_folder_part'] . '/' . ltrim($file, '/');
}
$page->head .= "\n" . '<link rel="stylesheet" type="text/css" href="' . common::GetDir($path) . '"/>';
return $path;
}
示例2: LayoutStyleFiles
/**
* Return a list of css files used by the current layout
*
*/
static function LayoutStyleFiles()
{
global $page, $dataDir;
$files = array();
$custom_file = $dataDir . '/data/_layouts/' . $page->gpLayout . '/custom.css';
//css file
if (file_exists($page->theme_dir . '/' . $page->theme_color . '/style.css')) {
$files[] = rawurldecode($page->theme_path) . '/style.css';
if ($page->gpLayout && file_exists($custom_file)) {
$files[] = gpOutput::CacheLess($custom_file);
}
return $files;
}
//less file
$files[] = $page->theme_dir . '/' . $page->theme_color . '/style.less';
//variables.less
$var_file = $page->theme_dir . '/' . $page->theme_color . '/variables.less';
if (file_exists($var_file)) {
$files[] = $var_file;
}
if ($page->gpLayout && file_exists($custom_file)) {
$files[] = $custom_file;
}
$files = array(gpOutput::CacheLess($files));
return $files;
}
示例3: PrepareLess
static function PrepareLess()
{
global $dataDir;
$less_files = $dataDir . '/include/css/admin.less';
gpOutput::CacheLess($less_files);
}