本文整理汇总了PHP中Assets::stylesheet_path方法的典型用法代码示例。如果您正苦于以下问题:PHP Assets::stylesheet_path方法的具体用法?PHP Assets::stylesheet_path怎么用?PHP Assets::stylesheet_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assets
的用法示例。
在下文中一共展示了Assets::stylesheet_path方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_stylesheet_path_should_not_touch_absolute_paths
function test_stylesheet_path_should_not_touch_absolute_paths()
{
$url = Assets::stylesheet_path('/some/style.css');
$this->assertEquals(STATIC_ASSETS_URL . 'some/style.css', $url);
}
示例2: _
$title = _("Kalender");
$resize = '';
if ($zeiten && !$kalender) { // popup Fenster verkleinern wenn kein Kalender
$resize = 'window.resizeTo(' . (($auth->auth["xres"] > 650) ? 780 : 600) . ',160);' . "\n";
$resize .= 'window.moveBy(0,330);' . "\n";
}
if (intval($submit) == 1) {
$do_submit = 'opener.document.' . $form_name . '.submit();';
$submit = '1';
} else {
$do_submit = '';
$submit = '';
}
if ($preset_error != '')
$zeiten = false;
$stylesheet = Assets::stylesheet_path('style.css');
echo <<<EOT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>$title</title>
<link rel="stylesheet" type="text/css" href="{$stylesheet}">
<script type="text/javascript">
<!--
window.setTimeout("window.close()", 120000); // Fenster automatisch wieder schließen :-)
$resize
function insert_time_noform() {
if (opener) {
$jsarray
var t;
var c = 999;
for (i=0; i < document.forms['TimeForm'].elements.timei.length; i++){
示例3: includeSqueezePackages
/**
* Depending on \Studip\ENV, either includes individual script
* elements for each JS file in every package, or a single script
* element containing the squeezed source code for every package.
*/
private static function includeSqueezePackages()
{
global $STUDIP_BASE_PATH;
$config_path = "{$STUDIP_BASE_PATH}/config/assets.yml";
$configuration = Configuration::load($config_path);
$packager = new Packager($configuration);
$javascripts = \Studip\Squeeze\includePackages($packager, self::getSqueezePackages());
$css = array();
foreach (self::getSqueezePackages() as $package) {
if (isset($configuration['css'][$package])) {
foreach ($configuration['css'][$package] as $filename => $media) {
$attributes = array('rel' => 'stylesheet', 'href' => \Studip\Squeeze\shouldPackage() ? $configuration['package_url'] . '/' . $package . '-' . $filename : Assets::stylesheet_path($filename), 'media' => $media);
$css[$package . '-' . $filename] = array('name' => 'link', 'attributes' => $attributes);
}
}
}
$files = array_merge($css, $javascripts);
// When not in development mode, add the current version number to
// the assets file, so browser caches will be informed about an
// update
if (Studip\ENV !== 'development') {
$v = preg_replace('/^(\\d+(?:\\.\\d+)*).*$/', '$1', $GLOBALS['SOFTWARE_VERSION']);
$files = array_map(function ($file) use($v) {
if ($file['name'] === 'link') {
$file['attributes']['href'] = URLHelper::getURL($file['attributes']['href'], compact('v'), true);
} else {
if ($file['name'] === 'script') {
$file['attributes']['src'] = URLHelper::getURL($file['attributes']['src'], compact('v'), true);
}
}
return $file;
}, $files);
}
return $files;
}
示例4: stylesheet
/**
* Returns a css link tag per source given as argument.
*
* Examples:
*
* Assets::stylesheet('style') =>
* <link href="/stylesheets/style.css" media="screen" rel="stylesheet">
*
* Assets::stylesheet('style', array('media' => 'all')) =>
* <link href="/stylesheets/style.css" media="all" rel="stylesheet">
*
* Assets::stylesheet('random.styles', '/css/stylish') =>
* <link href="/stylesheets/random.styles" media="screen" rel="stylesheet">
* <link href="/css/stylish.css" media="screen" rel="stylesheet">
*/
static function stylesheet($atLeastOneArgument)
{
$sources = func_get_args();
$sourceOptions = func_num_args() > 1 && is_array($sources[func_num_args() - 1]) ? array_pop($sources) : array();
$html = '';
foreach ($sources as $source) {
$source = Assets::stylesheet_path($source);
$opt = array_merge(array('rel' => 'stylesheet', 'media' => 'screen', 'href' => $source), $sourceOptions);
$html .= Assets::tag('link', $opt) . "\n";
}
return $html;
}