• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP stylesheet_path函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中stylesheet_path函数的典型用法代码示例。如果您正苦于以下问题:PHP stylesheet_path函数的具体用法?PHP stylesheet_path怎么用?PHP stylesheet_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了stylesheet_path函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: toHTML

    /**
     * Returns the rich text editor as HTML.
     *
     * @return string Rich text editor HTML representation
     */
    public function toHTML()
    {
        $options = $this->options;
        // we need to know the id for things the rich text editor
        // in advance of building the tag
        $id = _get_option($options, 'id', $this->name);
        // use tinymce's gzipped js?
        $tinymce_file = _get_option($options, 'tinymce_gzip') ? '/tiny_mce_gzip.php' : '/tiny_mce.js';
        // tinymce installed?
        // $js_path = sfConfig::get('sf_rich_text_js_dir') ? '/'.sfConfig::get('sf_rich_text_js_dir').$tinymce_file : '/sf/tinymce/js'.$tinymce_file;
        $js_path = sfConfig::get('sf_rich_text_js_dir') ? '/' . sfConfig::get('sf_rich_text_js_dir') . $tinymce_file : '/sf/tinymce/js' . $tinymce_file;
        if (!is_readable(sfConfig::get('sf_web_dir') . $js_path)) {
            throw new sfConfigurationException('You must install TinyMCE to use this helper (see rich_text_js_dir settings).');
        }
        sfContext::getInstance()->getResponse()->addJavascript($js_path);
        use_helper('Javascript');
        $tinymce_options = '';
        $style_selector = '';
        // custom CSS file?
        if ($css_file = _get_option($options, 'css')) {
            $css_path = stylesheet_path($css_file);
            sfContext::getInstance()->getResponse()->addStylesheet($css_path);
            $css = file_get_contents(sfConfig::get('sf_web_dir') . DIRECTORY_SEPARATOR . $css_path);
            $styles = array();
            preg_match_all('#^/\\*\\s*user:\\s*(.+?)\\s*\\*/\\s*\\015?\\012\\s*\\.([^\\s]+)#Smi', $css, $matches, PREG_SET_ORDER);
            foreach ($matches as $match) {
                $styles[] = $match[1] . '=' . $match[2];
            }
            $tinymce_options .= '  content_css: "' . $css_path . '",' . "\n";
            $tinymce_options .= '  theme_advanced_styles: "' . implode(';', $styles) . '"' . "\n";
            $style_selector = 'styleselect,separator,';
        }
        $culture = sfContext::getInstance()->getUser()->getCulture();
        $tinymce_js = '
tinyMCE.init({
  mode: "exact",
  language: "' . strtolower(substr($culture, 0, 2)) . '",
  elements: "' . $id . '",
  plugins: "table,advimage,advlink,flash",
  theme: "advanced",
  theme_advanced_toolbar_location: "top",
  theme_advanced_toolbar_align: "left",
  theme_advanced_path_location: "bottom",
  theme_advanced_buttons1: "' . $style_selector . 'justifyleft,justifycenter,justifyright,justifyfull,separator,bold,italic,strikethrough,separator,sub,sup,separator,charmap",
  theme_advanced_buttons2: "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,image,flash,separator,cleanup,removeformat,separator,code",
  theme_advanced_buttons3: "tablecontrols",
  extended_valid_elements: "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]",
  relative_urls: false,
  debug: false
  ' . ($tinymce_options ? ',' . $tinymce_options : '') . '
  ' . (isset($options['tinymce_options']) ? ',' . $options['tinymce_options'] : '') . '
});';
        if (isset($options['tinymce_options'])) {
            unset($options['tinymce_options']);
        }
        return content_tag('script', javascript_cdata_section($tinymce_js), array('type' => 'text/javascript')) . content_tag('textarea', $this->content, array_merge(array('name' => $this->name, 'id' => get_id_from_name($id, null)), _convert_options($options)));
    }
开发者ID:taryono,项目名称:school,代码行数:62,代码来源:sfRichTextEditorTinyMCE.class.php


示例2: stylesheet_link_tag

function stylesheet_link_tag($sources, $options = array())
{
    if (!is_array($sources)) {
        $sources = array($sources);
    }
    $html = '';
    foreach ($sources as $source) {
        $options = array_merge(array('rel' => 'stylesheet', 'type' => 'text/css', 'media' => 'screen'), $options);
        $options['href'] = stylesheet_path($source);
        $html .= tag('link', $options) . "\n";
    }
    return $html;
}
开发者ID:BackupTheBerlios,项目名称:stato-svn,代码行数:13,代码来源:asset_tag_helper.php


示例3: printJavascript

 public function printJavascript()
 {
     $this->addScriptContent("\n            \$('#ohrmTreeViewComponent_Tree').treeview({\n                collapsed: false,\n                control:'#ohrmTreeViewComponent_TreeController',\n                persist: 'location'\n            });\n\n            \$('#ohrmTreeViewComponent_Tree *').css('list-style', 'none'); // TODO: Move this to a stylesheet. Make sure to test in IE\n\n            \$('a[id^=\"treeLink_edit_\"]').click(function() {\n                loadNode(parseInt(\$(this).attr('id').replace('treeLink_edit_', '')));\n                _clearMessage();\n            });\n\n            \$('a[id^=\"treeLink_addChild_\"]').click(function() {\n                addChildToNode(parseInt(\$(this).attr('id').replace('treeLink_addChild_', '')));\n            });\n\n            \$('a[id^=\"treeLink_delete_\"]').click(function() {\n                deleteNode(parseInt(\$(this).attr('id').replace('treeLink_delete_', '')));\n            });\n\n            clearForm();\n");
     $this->addScriptFunction("\n            \$('form[id^=\"ohrmFormComponent_Form\"]').each(function() {\n                \$(this).parent().parent().show();\n            });\n            \$('.requirednotice').show();\n        ", 'showForm');
     $this->addScriptFunction("\n            \$('form[id^=\"ohrmFormComponent_Form\"]').each(function() {\n                \$(this).parent().parent().hide();\n            });\n            \$('.requirednotice').hide();\n        ", 'hideForm');
     $this->addScriptFunction("\n            \$('form[id^=\"ohrmFormComponent_Form\"] :input').filter(':not([type=\"button\"])').val('');\n            \$('.idValueLabel').html('');\n            \$('#lblParentNotice').remove();\n        ", 'clearForm');
     $html = '';
     $html .= content_tag('script', '', array('type' => 'text/javascript', 'src' => javascript_path('jquery.treeview.min.js')));
     if ($this->type == null) {
         $html .= tag('link', array('rel' => 'stylesheet', 'href' => stylesheet_path('jquery-treeview/jquery.treeview.css')));
     } else {
         $html .= tag('link', array('rel' => 'stylesheet', 'href' => stylesheet_path('jquery-treeview/jquery.treeview_1.css')));
     }
     $this->addScriptContent(array('$(document).ready(function() {', '});'), 'wrap');
     $this->addScriptContent($this->getScriptFunctionsString());
     $this->addScriptContent(array('//<![CDATA[', '//]]>'), 'wrap');
     $html .= content_tag('script', $this->scriptContent, array('type' => 'text/javascript'));
     echo $html;
     return true;
 }
开发者ID:THM068,项目名称:orangehrm,代码行数:20,代码来源:ohrmTreeViewComponent.php


示例4: stylesheet_tag

/**
 * Returns a css <link> tag per source given as argument,
 * to be included in the <head> section of a HTML document.
 *
 * <b>Options:</b>
 * - rel - defaults to 'stylesheet'
 * - type - defaults to 'text/css'
 * - media - defaults to 'screen'
 *
 * <b>Examples:</b>
 * <code>
 *  echo stylesheet_tag('style');
 *    => <link href="/stylesheets/style.css" media="screen" rel="stylesheet" type="text/css" />
 *  echo stylesheet_tag('style', array('media' => 'all'));
 *    => <link href="/stylesheets/style.css" media="all" rel="stylesheet" type="text/css" />
 *  echo stylesheet_tag('style', array('raw_name' => true));
 *    => <link href="style" media="all" rel="stylesheet" type="text/css" />
 *  echo stylesheet_tag('random.styles', '/css/stylish');
 *    => <link href="/stylesheets/random.styles" media="screen" rel="stylesheet" type="text/css" />
 *       <link href="/css/stylish.css" media="screen" rel="stylesheet" type="text/css" />
 * </code>
 *
 * @param string asset names
 * @param array  additional HTML compliant <link> tag parameters
 *
 * @return string XHTML compliant <link> tag(s)
 * @see    stylesheet_path
 */
function stylesheet_tag($source, $options = array())
{
    if (!is_array($options)) {
        $options = array();
    }
    $options += array('absolute' => false);
    if (empty($options['raw_name'])) {
        $source = stylesheet_path($source, $options['absolute']);
    }
    $tag = tag('link', array_diff_key($options + array('href' => $source, 'media' => 'screen', 'rel' => 'stylesheet', 'type' => 'text/css'), array('absolute' => 'abosolute', 'condition' => 'condition', 'raw_name' => 'raw_name')));
    if (isset($options['condition'])) {
        $tag = comment_as_conditional($options['condition'], $tag);
    }
    return $tag . "\n";
}
开发者ID:nurfiantara,项目名称:ehri-ica-atom,代码行数:43,代码来源:AssetHelper.php


示例5: stylesheet_link_tag

function stylesheet_link_tag( $sources )
{
	$options = ( is_array( $sources[ count( $sources ) - 1 ] ) ? array_pop( $sources ) : array() );
	$n_sources = array();
	foreach( $sources as $source )
	{
		$source = stylesheet_path( $source );
		array_push( $n_sources, tag( 'link', array_merge( array( 'rel' => 'stylesheet', 'type' => 'text/css', 'media' => 'screen', 'href' => $source ), $options ) ) );
	}
	return join( "\n", $n_sources )."\n";
}
开发者ID:rgantt,项目名称:sake,代码行数:11,代码来源:asset_tag_helper.php


示例6: _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
//.........这里部分代码省略.........
开发者ID:hashir,项目名称:UoA,代码行数:101,代码来源:aHelper.php


示例7: MyForm

$response = sfContext::getInstance()->getResponse();
$form = new MyForm();

$response->resetAssets();
use_stylesheets_for_form($form);
$t->is_deeply($response->getStylesheets(), array('/path/to/a/foo.css' => array('media' => 'all'), '/path/to/a/bar.css' => array('media' => 'print')), 'use_stylesheets_for_form() adds stylesheets to the response');

$response->resetAssets();
use_javascripts_for_form($form);
$t->is_deeply($response->getJavaScripts(), array('/path/to/a/foo.js' => array(), '/path/to/a/bar.js' => array()), 'use_javascripts_for_form() adds javascripts to the response');

// custom web paths
$t->diag('Custom asset path handling');

sfConfig::set('sf_web_js_dir_name', 'static/js');
$t->is(javascript_path('xmlhr'), '/static/js/xmlhr.js', 'javascript_path() decorates a relative filename with js dir name and extension with custom js dir');
$t->is(javascript_include_tag('xmlhr'),
  '<script type="text/javascript" src="/static/js/xmlhr.js"></script>'."\n",
  'javascript_include_tag() takes a javascript name as its first argument');

sfConfig::set('sf_web_css_dir_name', 'static/css');
$t->is(stylesheet_path('style'), '/static/css/style.css', 'stylesheet_path() decorates a relative filename with css dir name and extension with custom css dir');
$t->is(stylesheet_tag('style'),
  '<link rel="stylesheet" type="text/css" media="screen" href="/static/css/style.css" />'."\n",
  'stylesheet_tag() takes a stylesheet name as its first argument');

sfConfig::set('sf_web_images_dir_name', 'static/img');
$t->is(image_path('img'), '/static/img/img.png', 'image_path() decorates a relative filename with images dir name and png extension with custom images dir');
$t->is(image_tag('test'), '<img src="/static/img/test.png" />', 'image_tag() takes an image name as its first argument');
开发者ID:nationalfield,项目名称:symfony,代码行数:29,代码来源:AssetHelperTest.php


示例8: stylesheet

function stylesheet($file, $options = null)
{
    $file = stylesheet_path($file);
    $options = html_parse_params($options);
    return '<link href="' . $file . '" rel="stylesheet" type="text/css"' . $options . ' />';
}
开发者ID:brego,项目名称:prank,代码行数:6,代码来源:html.php


示例9: sympal_use_jquery

<?php

sympal_use_jquery();
?>
<script type="text/javascript" src="<?php 
echo javascript_path('/sfSympalEditorPlugin/js/links.js');
?>
"></script>
<link rel="stylesheet" type="text/css" media="screen" href="<?php 
echo stylesheet_path('/sfSympalEditorPlugin/css/links.css');
?>
" />

<div id="sympal_links_container">
  <h1><?php 
echo __('Link Browser');
?>
</h1>

  <p>
    <?php 
echo __('Browse your content below and insert links into the currently focused editor by ' . 'just clicking the page you want to link to.');
?>
    <?php 
echo __('You can control where the link is inserted by positioning the cursor in the editor.');
?>
  </p>

  <div id="content_types">
    <h2><?php 
echo __('Content Types');
开发者ID:slemoigne,项目名称:sympal,代码行数:31,代码来源:linksSuccess.php


示例10: _configureStylist

  protected function _configureStylist() {
		$cssArray = sfContext::getInstance()->getResponse()->getStylesheets();
		$cssArray = $this->getOption('css_files')? array_merge($cssArray, $this->getOption('css_files')): $cssArray;
		foreach ($cssArray as $file => $options) {
				$this->_additionalConfig .= 'xinha_config.stylistLoadStylesheet("'.stylesheet_path($file).'");'."\n";
		}
  }
开发者ID:rmed19,项目名称:sfWidgetFormTextareaXinha.class.php,代码行数:7,代码来源:sfWidgetFormTextareaXinha.class.php


示例11: array

$t->is(javascript_include_tag('xmlhr', array('absolute' => true)), '<script type="text/javascript" src="http://localhost/js/xmlhr.js"></script>' . "\n", 'javascript_include_tag() can take an absolute option to output an absolute file name');
$t->is(javascript_include_tag('xmlhr', array('raw_name' => true)), '<script type="text/javascript" src="xmlhr"></script>' . "\n", 'javascript_include_tag() can take a raw_name option to bypass file name decoration');
$t->is(javascript_include_tag('xmlhr', array('defer' => 'defer')), '<script type="text/javascript" src="/js/xmlhr.js" defer="defer"></script>' . "\n", 'javascript_include_tag() can take additional html options like defer');
$t->is(javascript_include_tag('xmlhr', array('condition' => 'IE 6')), '<!--[if IE 6]><script type="text/javascript" src="/js/xmlhr.js"></script><![endif]-->' . "\n", 'javascript_include_tag() can take a condition option');
// javascript_path()
$t->diag('javascript_path()');
$t->is(javascript_path('xmlhr'), '/js/xmlhr.js', 'javascript_path() decorates a relative filename with js dir name and extension');
$t->is(javascript_path('/xmlhr'), '/xmlhr.js', 'javascript_path() does not decorate absolute file names with js dir name');
$t->is(javascript_path('xmlhr.foo'), '/js/xmlhr.foo', 'javascript_path() does not decorate file names with extension with .js');
$t->is(javascript_path('xmlhr.foo', true), 'http://localhost/js/xmlhr.foo', 'javascript_path() accepts a second parameter to output an absolute resource path');
// stylesheet_path()
$t->diag('stylesheet_path()');
$t->is(stylesheet_path('style'), '/css/style.css', 'stylesheet_path() decorates a relative filename with css dir name and extension');
$t->is(stylesheet_path('/style'), '/style.css', 'stylesheet_path() does not decorate absolute file names with css dir name');
$t->is(stylesheet_path('style.foo'), '/css/style.foo', 'stylesheet_path() does not decorate file names with extension with .css');
$t->is(stylesheet_path('style.foo', true), 'http://localhost/css/style.foo', 'stylesheet_path() accepts a second parameter to output an absolute resource path');
// image_path()
$t->diag('image_path()');
$t->is(image_path('img'), '/images/img.png', 'image_path() decorates a relative filename with images dir name and png extension');
$t->is(image_path('/img'), '/img.png', 'image_path() does not decorate absolute file names with images dir name');
$t->is(image_path('img.jpg'), '/images/img.jpg', 'image_path() does not decorate file names with extension with .png');
$t->is(image_path('img.jpg', true), 'http://localhost/images/img.jpg', 'image_path() accepts a second parameter to output an absolute resource path');
// use_javascript() get_javascripts()
$t->diag('use_javascript() get_javascripts()');
use_javascript('xmlhr');
$t->is(get_javascripts(), '<script type="text/javascript" src="/js/xmlhr.js"></script>' . "\n", 'get_javascripts() returns a javascript previously added by use_javascript()');
use_javascript('xmlhr', '', array('raw_name' => true));
$t->is(get_javascripts(), '<script type="text/javascript" src="xmlhr"></script>' . "\n", 'use_javascript() accepts an array of options as a third parameter');
use_javascript('xmlhr', '', array('absolute' => true));
$t->is(get_javascripts(), '<script type="text/javascript" src="http://localhost/js/xmlhr.js"></script>' . "\n", 'use_javascript() accepts an array of options as a third parameter');
use_javascript('xmlhr');
开发者ID:mediasadc,项目名称:alba,代码行数:31,代码来源:AssetHelperTest.php


示例12: javascript_path

<script type="text/javascript" src="<?php 
echo javascript_path(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/js/links.js'));
?>
"></script>
<link rel="stylesheet" type="text/css" media="screen" href="<?php 
echo stylesheet_path(sfSympalConfig::getAssetPath('/sfSympalEditorPlugin/css/links.css'));
?>
" />

<div id="sympal_links_container">
  <h1><?php 
echo __('Link Browser');
?>
</h1>

  <p>
    <?php 
echo __('Browse your content below and insert links into the currently focused editor by ' . 'just clicking the page you want to link to.');
?>
    <?php 
echo __('You can control where the link is inserted by positioning the cursor in the editor.');
?>
  </p>

  <div id="content_types">
    <h2><?php 
echo __('Content Types');
?>
</h2>
    <ul>
      <?php 
开发者ID:sympal,项目名称:sympal,代码行数:31,代码来源:linksSuccess.php


示例13: stylesheet_path

	<meta http-equiv="X-UA-Compatible" content="IE=7" />
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel="stylesheet" type="text/css" href="<?php 
echo stylesheet_path('../sfSqlDesignerPlugin/css/style');
?>
" media="all" />
	<!--[if IE 6]><link rel="stylesheet" type="text/css" href="<?php 
echo stylesheet_path('../sfSqlDesignerPlugin/css/ie6');
?>
" /><![endif]-->
	<!--[if IE 7]><link rel="stylesheet" type="text/css" href="<?php 
echo stylesheet_path('../sfSqlDesignerPlugin/css/ie7');
?>
" /><![endif]-->
	<link rel="stylesheet" href="<?php 
echo stylesheet_path('../sfSqlDesignerPlugin/css/print');
?>
" type="text/css" media="print" />
	<script type="text/javascript" src="<?php 
echo javascript_path('../sfSqlDesignerPlugin/js/oz');
?>
"></script>
	<script type="text/javascript" src="<?php 
echo javascript_path('../sfSqlDesignerPlugin/js/config');
?>
"></script>
	<script type="text/javascript" src="<?php 
echo javascript_path('../sfSqlDesignerPlugin/js/wwwsqldesigner');
?>
"></script>
	<script type="text/javascript" src="<?php 
开发者ID:jphpsf,项目名称:sfSqlDesignerPlugin,代码行数:31,代码来源:designerSuccess.php


示例14: get_combined_stylesheets

/**
 * @see get_combined_javascripts
 */
function get_combined_stylesheets($groups = null, $groupType = sfCombinePlusManager::GROUP_INCLUDE, $onlyUnusedGroups = true, $markGroupsUsed = true)
{
    if (!sfConfig::get('app_sfCombinePlusPlugin_enabled', false)) {
        return get_stylesheets();
    }
    $manager = sfCombinePlusManager::getCssManager();
    sfConfig::set('symfony.asset.stylesheets_included', true);
    $response = sfContext::getInstance()->getResponse();
    $config = sfConfig::get('app_sfCombinePlusPlugin_css', array());
    $doNotCombine = isset($config['combine_skip']) ? $config['combine_skip'] : array();
    $manager->setSkips(array_merge($manager->getSkips(), $doNotCombine));
    $groupedFiles = $manager->getAssetsByGroup($response->getStylesheets(), $config['combine'], $groups, $groupType, $onlyUnusedGroups, $markGroupsUsed);
    $html = '';
    foreach ($groupedFiles as $fileDetails) {
        if (!$fileDetails['combinable']) {
            $html .= stylesheet_tag(stylesheet_path($fileDetails['files']), $fileDetails['options']);
        } else {
            $route = isset($config['route']) ? $config['route'] : 'sfCombinePlus';
            $html .= stylesheet_tag(url_for('@' . $route . '?module=sfCombinePlus&action=js&' . sfCombinePlusUrl::getUrlString($fileDetails['files'])), $fileDetails['options']);
        }
    }
    return $html;
}
开发者ID:kevindew,项目名称:sfCombinePlusPlugin,代码行数:26,代码来源:sfCombinePlusHelper.php


示例15: getAssetPath

 protected function getAssetPath($file)
 {
     sfProjectConfiguration::getActive()->loadHelpers('Asset');
     return stylesheet_path($file);
 }
开发者ID:cbsistem,项目名称:appflower_engine,代码行数:5,代码来源:sfCombineCss.class.php


示例16: minify_get_stylesheets

function minify_get_stylesheets($position_array = array('first', '', 'last'), $debug = false, $my_already_seen = array())
{
    $response = sfContext::getInstance()->getResponse();
    $response->setParameter('stylesheets_included', true, 'symfony/view/asset');
    $app_static_url = sfConfig::get('app_static_url');
    $already_seen = $my_already_seen;
    $minify_files = array();
    foreach ($position_array as $position) {
        foreach ($response->getStylesheets($position) as $files => $options) {
            if (!is_array($files)) {
                $files = array($files);
            }
            $options = array_merge(array('rel' => 'stylesheet', 'type' => 'text/css', 'media' => 'all'), $options);
            foreach ($files as $file) {
                if (isset($already_seen[$file])) {
                    continue;
                }
                $already_seen[$file] = 1;
                $absolute = false;
                if (isset($options['absolute'])) {
                    unset($options['absolute']);
                    $absolute = true;
                }
                if (!isset($options['raw_name'])) {
                    $file = stylesheet_path($file, $absolute);
                } else {
                    unset($options['raw_name']);
                }
                $type = serialize($options);
                if (isset($minify_files[$type])) {
                    array_push($minify_files[$type], $file);
                } else {
                    $minify_files[$type] = array($file);
                }
            }
        }
    }
    $html = '';
    foreach ($minify_files as $options => $files) {
        $options = unserialize($options);
        $options['href'] = minify_get_combined_files_url($files, $debug);
        $html .= tag('link', $options) . "\n";
    }
    return $html;
}
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:45,代码来源:MyMinifyHelper.php


示例17: _drawTestTree

 /**
  * @deprecated
  */
 private function _drawTestTree()
 {
     $listItems = '';
     for ($i = 1; $i <= 5; $i++) {
         $subListItems = array();
         for ($j = 1; $j <= rand(0, 8); $j++) {
             $subListItems[] = content_tag('li', "\n\t" . content_tag('a', "Sub List Item {$i}-{$j}", array('href' => "?#{$i}-{$j}"))) . "\n";
         }
         $subListItems = count($subListItems) > 0 ? content_tag('ul', "\n" . implode('', $subListItems)) : '';
         $listItems[] = content_tag('li', "\n\t" . content_tag('a', "Item {$i}", array('href' => "?#{$i}")) . "{$subListItems}");
     }
     $listItems = "\n" . implode('', $listItems);
     $html = '';
     $html .= content_tag('script', '', array('type' => 'text/javascript', 'src' => javascript_path('jquery.treeview.min.js')));
     $html .= tag('link', array('rel' => 'stylesheet', 'href' => stylesheet_path('jquery-treeview/jquery.treeview.css')));
     $html .= content_tag('a', 'Collapse All', array('href' => '?#'));
     $html .= ' | ';
     $html .= content_tag('a', 'Expand All', array('href' => '?#'));
     $html = content_tag('div', $html, array('id' => 'ohrmTreeViewComponent_TreeController', 'class' => 'treecontrol'));
     $html .= content_tag('div', $this->getPropertyObject()->getRootLabel(), array('id' => 'ohrmTreeViewComponent_TreeHeader'));
     $html .= content_tag('ul', $listItems, array('id' => 'ohrmTreeViewComponent_Tree'));
     return $html;
 }
开发者ID:abdocmd,项目名称:orangehrm-3.0.1,代码行数:26,代码来源:ohrmTreeViewComponent.php


示例18: stylesheet_link_tag

function stylesheet_link_tag($file, $media = 'screen')
{
    return "<link href=\"" . stylesheet_path($file) . "\" media=\"{$media}\" rel=\"Stylesheet\" type=\"text/css\" />\n";
}
开发者ID:brysonian,项目名称:Saint,代码行数:4,代码来源:PHTMLView.php


示例19: stylesheet_path

<link rel="stylesheet" type="text/css" media="screen" href="<?php 
echo stylesheet_path('/sfSympalAssetsPlugin/css/select.css');
?>
" />
<script type="text/javascript" src="<?php 
echo javascript_path('/sfSympalAssetsPlugin/js/select.js');
?>
"></script>
<?php 
use_helper('jQuery');
?>

<div id="sympal_assets_container" class="sympal_form">
  <h1><?php 
echo __('Asset Browser');
?>
</h1>

  <p>
    <?php 
echo __('Browse your assets below and insert them into the currently focused editor by
just clicking the asset you want to insert. You can control where the asset is 
inserted by positioning the cursor in the editor. You may also upload new assets
and create directories below.');
?>
  </p>

  <input type="hidden" id="current_url" value="<?php 
echo $sf_request->getUri();
?>
" />
开发者ID:slemoigne,项目名称:sympal,代码行数:31,代码来源:selectSuccess.php


示例20: getAssetPath

 /**
  * @see sfCombineCombiner
  */
 public function getAssetPath($file)
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers('Asset');
     return stylesheet_path($file);
 }
开发者ID:korenskoy,项目名称:sfCombinePlugin,代码行数:8,代码来源:sfCombineCombinerCss.class.php



注:本文中的stylesheet_path函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP stylesheet_tag函数代码示例发布时间:2022-05-23
下一篇:
PHP stylesheet_link_tag函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap