本文整理汇总了PHP中stylesheet_tag函数的典型用法代码示例。如果您正苦于以下问题:PHP stylesheet_tag函数的具体用法?PHP stylesheet_tag怎么用?PHP stylesheet_tag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了stylesheet_tag函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cdn_stylesheet_tag
/**
* Generates a HTML CSS Tag, refering to our amazon bucketde
*
* @author Christian Weyand
* @param string $pFilename
* @param array() $pOptions
* @return unknown_type
*/
function cdn_stylesheet_tag($pFilename, $pOptions = array())
{
if (sfConfig::get("sf_environment") != "dev") {
$pFilename = concatNameWithRevision($pFilename, 'css');
}
return stylesheet_tag($pFilename, $pOptions);
}
示例2: get_combined_stylesheets
/**
* Returns <link> tags with the url toward all stylesheets configured in view.yml or added to the response object.
*
* You can use this helper to decide the location of stylesheets in pages.
* By default, if you don't call this helper, symfony will automatically include stylesheets before </head>.
* Calling this helper disables this behavior.
*
* @return string <link> tags
*/
function get_combined_stylesheets()
{
if (!sfConfig::get('app_sfCombinePlugin_enabled', false)) {
return get_stylesheets();
}
$response = sfContext::getInstance()->getResponse();
sfConfig::set('symfony.asset.stylesheets_included', true);
$configSfCombinePlugin['css'] = sfConfig::get('app_sfCombinePlugin_css', array());
$html = '';
$cssFiles = $include_tags = array();
foreach (array('first', '', 'last') as $position) {
foreach ($response->getStylesheets($position) as $files => $options) {
if (!in_array($files, $configSfCombinePlugin['css']['online']) && !in_array($files, $configSfCombinePlugin['css']['offline'])) {
if (!is_array($files)) {
$files = array($files);
}
$cssFiles = array_merge($cssFiles, $files);
} else {
$include_tags[] = stylesheet_tag(url_for($files));
}
}
}
$key = _get_key($cssFiles);
$include_tags[] = str_replace('.css', '', stylesheet_tag(url_for('sfCombine/css?key=' . $key)));
return implode("", $include_tags);
}
示例3: renderMenu
function renderMenu()
{
echo javascript_include_tag('sfShowHideMenu/ClickShowHideMenu.js');
echo stylesheet_tag('sfShowHideMenu/ClickShowHideMenu.css');
echo $this->buildMenuData();
$menu_js = "var clickMenu1 = new ClickShowHideMenu('click-menu1');\n clickMenu1.init();\n";
echo javascript_tag($menu_js);
}
示例4: renderHtml
function renderHtml()
{
echo stylesheet_tag('sfToolbar/dhtmlXToolbar.css');
echo javascript_include_tag('sfToolbar/dhtmlXProtobar.js');
echo javascript_include_tag('sfToolbar/dhtmlXToolbar.js');
echo javascript_include_tag('sfToolbar/dhtmlXCommon.js');
echo $this->renderTable();
echo javascript_tag($this->buildData());
}
示例5: op_smt_get_stylesheets
/**
* Returns <link> tags for all stylesheets smartphone pages added to the response object.
*
* You can use this helper to decide the location of stylesheets in pages.
* By default, if you don't call this helper, openpne will automatically include stylesheets before </head>.
* Calling this helper disables this behavior.
*
* @return string <link> tags
*
* @see get_stylesheets()
*/
function op_smt_get_stylesheets()
{
$response = sfContext::getInstance()->getResponse();
sfConfig::set('symfony.asset.stylesheets_included', true);
$html = '';
foreach ($response->getSmtStylesheets() as $file => $options) {
$html .= stylesheet_tag($file, $options);
}
return $html;
}
示例6: renderMenu
function renderMenu()
{
echo stylesheet_tag('sfTreeMenu/DynamicTree.css');
echo javascript_include_tag('sfTreeMenu/ie5.js');
echo javascript_include_tag('sfTreeMenu/DynamicTree.js');
echo $this->renderMenuData();
$append_js = <<<EOD
\t\t
var tree = new DynamicTree("tree");
tree.init();
\t\t
EOD;
echo javascript_tag($append_js);
}
示例7: printAssetPaths
function printAssetPaths($assets, $plugin = '')
{
if (count($assets) > 0) {
foreach ($assets as $key => $asset) {
$assetType = substr($asset, strrpos($asset, '.') + 1);
if ($plugin == '') {
echo javascript_include_tag($asset);
} elseif ($assetType == 'js') {
echo javascript_include_tag(plugin_web_path($plugin, 'js/' . $asset));
} elseif ($assetType == 'css') {
echo stylesheet_tag(plugin_web_path($plugin, 'css/' . $asset));
} else {
echo $assetType;
}
}
}
}
示例8: render
/**
* Renders the widget.
*
* @param string $name The element name
* @param string $value The value displayed in this widget
* @param array $attributes An array of HTML attributes to be merged with the default HTML attributes
* @param array $errors An array of errors for the field
*
* @return string An HTML tag string
* @see sfWidgetForm
*/
public function render($name, $value = null, $attributes = array(), $errors = array())
{
if (!$this->getAttribute('size')) {
$this->setAttribute('size', $this->getOption('with_time') ? 15 : 9);
}
$this->default_picker_options['timeFormat'] = $this->getOption('time_format');
$this->default_picker_options['dateFormat'] = $this->getOption('date_format');
$this->default_picker_options['showSecond'] = strstr($this->getOption('time_format'), 'ss') !== false;
if ($timestamp = strtotime($value)) {
$value = strtr($this->getOption('date_format'), array('yy' => date('Y', $timestamp), 'mm' => date('m', $timestamp), 'dd' => date('d', $timestamp), 'y' => date('y', $timestamp), 'm' => date('n', $timestamp), 'd' => date('j', $timestamp)));
if ($this->getOption('with_time')) {
$value .= ' ' . strtr($this->getOption('time_format'), array('hh' => date('H', $timestamp), 'mm' => date('i', $timestamp), 'ss' => date('s', $timestamp), 'h' => date('G', $timestamp), 'm' => intval(date('i', $timestamp)), 's' => intval(date('s', $timestamp))));
}
}
// Generate the datePicker javascript code
$jq_picker_options = array_merge($this->default_picker_options, $this->getOption('jq_picker_options'));
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
$jq_picker_options = json_encode($jq_picker_options, JSON_FORCE_OBJECT);
} else {
$jq_picker_options = json_encode($jq_picker_options);
}
$jq_picker_options = str_replace('\\/', '/', $jq_picker_options);
// Fix for: http://bugs.php.net/bug.php?id=49366
$pickerClass = $this->getOption('with_time') ? 'datetimepicker' : 'datepicker';
$id = $this->generateId($name);
$attributes['class'] = 'sfDateTimePicker' . (isset($attributes['class']) ? ' ' . $attributes['class'] : '');
$html = parent::render($name, $value, $attributes, $errors);
foreach ($this->getStylesheets() as $file => $options) {
$html .= stylesheet_tag($file, $options);
}
foreach ($this->getJavaScripts() as $file) {
$html .= javascript_include_tag($file);
}
$html .= <<<EOHTML
<script type="text/javascript">
jQueryPicker(function(){
jQueryPicker("#{$id}").{$pickerClass}({$jq_picker_options});
// jQueryPicker(".ui-datepicker").draggable();
});
</script>
EOHTML;
return $html;
}
示例9: sw_get_stylesheets
function sw_get_stylesheets()
{
$params = sfConfig::get('app_swToolbox_swCombine', array('version' => false));
$version = $params['version'];
$response = sfContext::getInstance()->getResponse();
$included_files = $response->getCombinedAssets();
sfConfig::set('symfony.asset.stylesheets_included', true);
$html = '';
foreach ($response->getStylesheets() as $file => $options) {
// avoid loading combined files
if (in_array($file, $included_files)) {
continue;
}
$file = $version ? $file . '?v=' . $version : $file;
$html .= stylesheet_tag($file, $options);
}
return $html;
}
示例10: renderMenu
function renderMenu()
{
echo $this->display_mode == "vertical" ? stylesheet_tag('sfDropDownMenu/vertical.css') : stylesheet_tag('sfDropDownMenu/horizontal.css');
echo javascript_include_tag('sfDropDownMenu/ie5.js');
echo javascript_include_tag('sfDropDownMenu/XulMenu.js');
$image_arrow1 = image_path('sfDropDownMenu/arrow1.gif');
$image_arrow2 = image_path('sfDropDownMenu/arrow2.gif');
$preload_image_js = <<<EOD
\t\t
/* preload images */
var arrow1 = new Image(4, 7);
arrow1.src = "{$image_arrow1}";
var arrow2 = new Image(4, 7);
arrow2.src = "{$image_arrow2}";
\t\t
EOD;
echo javascript_tag($preload_image_js);
echo $this->renderMenuData();
}
示例11: get_combined_stylesheets
/**
* Returns <link> tags with the url toward all stylesheets configured in view.yml or added to the response object.
*
* You can use this helper to decide the location of stylesheets in pages.
* By default, if you don't call this helper, symfony will automatically include stylesheets before </head>.
* Calling this helper disables this behavior.
*
* @return string <link> tags
*/
function get_combined_stylesheets()
{
if (!sfConfig::get('app_sfCombinePlugin_enabled', false)) {
return get_stylesheets();
}
sfConfig::set('symfony.asset.stylesheets_included', true);
$html = '';
$cssFiles = array();
$response = sfContext::getInstance()->getResponse();
foreach ($response->getStylesheets() as $files => $options) {
if (!is_array($files)) {
$files = array($files);
}
$cssFiles = array_merge($cssFiles, $files);
}
if (!empty($cssFiles)) {
$html .= str_replace(array('.css', '.pcss'), '', stylesheet_tag(url_for('sfCombine/css?key=' . _get_key($cssFiles))));
}
return $html;
}
示例12: include_http_metas
<?php
include_http_metas();
include_metas();
include_title();
use_stylesheet('/sf/sf_default/css/screen.css', 'last');
include_stylesheets();
include_javascripts();
?>
<?php
//<link rel="shortcut icon" href="/favicon.ico" />
?>
<!--[if lt IE 7.]>
<?php
echo stylesheet_tag('/sf/sf_default/css/ie.css');
?>
<![endif]-->
</head>
<body>
<div class="sfTContainer">
<?php
echo link_to(image_tag('/sf/sf_default/images/sfTLogo.png', array('alt' => 'symfony PHP Framework', 'class' => 'sfTLogo', 'size' => '186x39')), 'http://www.symfony-project.org/');
?>
<?php
echo $sf_content;
?>
</div>
</body>
</html>
示例13: get_stylesheets
/**
* Returns <link> tags for all stylesheets configured in view.yml or added to the response object.
*
* You can use this helper to decide the location of stylesheets in pages.
* By default, if you don't call this helper, symfony will automatically include stylesheets before </head>.
* Calling this helper disables this behavior.
*
* @return string <link> tags
*/
function get_stylesheets()
{
$response = sfContext::getInstance()->getResponse();
$response->setParameter('stylesheets_included', true, 'symfony/view/asset');
$already_seen = array();
$html = '';
foreach (array('first', '', 'last') as $position) {
foreach ($response->getStylesheets($position) as $files => $options) {
if (!is_array($files)) {
$files = array($files);
}
foreach ($files as $file) {
$file = stylesheet_path($file);
if (isset($already_seen[$file])) {
continue;
}
$already_seen[$file] = 1;
$html .= stylesheet_tag($file, $options);
}
}
}
return $html;
}
示例14: stylesheet_tag
</script>
<?php
echo stylesheet_tag("lib/dijit/themes/claro/claro.css");
?>
<?php
echo stylesheet_tag("css/layout.css");
?>
<?php
if ($_SESSION["uid"]) {
$theme = get_pref("USER_CSS_THEME", $_SESSION["uid"], false);
if ($theme && theme_valid("{$theme}")) {
echo stylesheet_tag("themes/{$theme}");
} else {
echo stylesheet_tag("themes/default.css");
}
}
?>
<?php
print_user_stylesheet();
?>
<link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
<link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
<?php
foreach (array("lib/prototype.js", "lib/scriptaculous/scriptaculous.js?load=effects,controls", "lib/dojo/dojo.js", "lib/dojo/tt-rss-layer.js", "errors.php?mode=js") as $jsfile) {
echo javascript_tag($jsfile);
}
示例15: _a_get_assets_body
function _a_get_assets_body($type, $assets)
{
$gzip = sfConfig::get('app_a_minify_gzip', false);
sfConfig::set('symfony.asset.' . $type . '_included', true);
$html = '';
// We need our own copy of the trivial case here because we rewrote the asset list
// for stylesheets after LESS compilation, and there is no way to
// reset the list in the response object
if (!sfConfig::get('app_a_minify', false)) {
// This branch is seen only for CSS, because javascript calls the original Symfony
// functionality when minify is off
foreach ($assets as $file => $options) {
$html .= stylesheet_tag($file, $options);
}
return $html;
}
$sets = array();
foreach ($assets as $file => $options) {
if (preg_match('/^http(s)?:/', $file) || isset($options['data-minify']) && $options['data-minify'] === 0) {
// Nonlocal URL or minify was explicitly shut off.
// Don't get cute with it, otherwise things
// like Addthis and ckeditor don't work
if ($type === 'stylesheets') {
$html .= stylesheet_tag($file, $options);
} else {
$html .= javascript_include_tag($file, $options);
}
continue;
}
/*
*
* Guts borrowed from stylesheet_tag and javascript_tag. We still do a tag if it's
* a conditional stylesheet
*
*/
$absolute = false;
if (isset($options['absolute']) && $options['absolute']) {
unset($options['absolute']);
$absolute = true;
}
$condition = null;
if (isset($options['condition'])) {
$condition = $options['condition'];
unset($options['condition']);
}
if (!isset($options['raw_name'])) {
if ($type === 'stylesheets') {
$file = stylesheet_path($file, $absolute);
} else {
$file = javascript_path($file, $absolute);
}
} else {
unset($options['raw_name']);
}
if (is_null($options)) {
$options = array();
}
if ($type === 'stylesheets') {
$options = array_merge(array('rel' => 'stylesheet', 'type' => 'text/css', 'media' => 'screen', 'href' => $file), $options);
} else {
$options = array_merge(array('type' => 'text/javascript', 'src' => $file), $options);
}
if (null !== $condition) {
$tag = tag('link', $options);
$tag = comment_as_conditional($condition, $tag);
$html .= $tag . "\n";
} else {
unset($options['href'], $options['src']);
$optionGroupKey = json_encode($options);
$set[$optionGroupKey][] = $file;
}
// echo($file);
// $html .= "<style>\n";
// $html .= file_get_contents(sfConfig::get('sf_web_dir') . '/' . $file);
// $html .= "</style>\n";
}
// CSS files with the same options grouped together to be loaded together
foreach ($set as $optionsJson => $files) {
$groupFilename = aAssets::getGroupFilename($files);
$groupFilename .= $type === 'stylesheets' ? '.css' : '.js';
if ($gzip) {
$groupFilename .= 'gz';
}
$dir = aFiles::getUploadFolder(array('asset-cache'));
if (!file_exists($dir . '/' . $groupFilename)) {
$content = '';
foreach ($files as $file) {
$path = null;
if (sfConfig::get('app_a_stylesheet_cache_http', false)) {
$url = sfContext::getRequest()->getUriPrefix() . $file;
$fileContent = file_get_contents($url);
} else {
$path = sfConfig::get('sf_web_dir') . $file;
$fileContent = file_get_contents($path);
}
if ($type === 'stylesheets') {
$options = array();
if (!is_null($path)) {
// Rewrite relative URLs in CSS files.
// This trick is available only when we don't insist on
//.........这里部分代码省略.........