当前位置: 首页>>代码示例>>PHP>>正文


PHP HtmlHelper::css方法代码示例

本文整理汇总了PHP中HtmlHelper::css方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlHelper::css方法的具体用法?PHP HtmlHelper::css怎么用?PHP HtmlHelper::css使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HtmlHelper的用法示例。


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

示例1: bootstrapCss

 public function bootstrapCss($url = 'bootstrap.min.css', $rel = null, $options = array())
 {
     $pluginRoot = dirname(dirname(DIRNAME(__FILE__)));
     $pluginName = end(explode(DS, $pluginRoot));
     $url = '/' . Inflector::underscore($pluginName) . '/css/' . $url;
     return parent::css($url, $rel, $options);
 }
开发者ID:racklin,项目名称:TwitterBootstrap,代码行数:7,代码来源:BootstrapHtmlHelper.php

示例2: _addScripts

 /**
  * _addScripts method
  *
  * Adds properties
  *
  * @param mixed $view
  * @return boolean
  */
 public function _addScripts($view)
 {
     if ($this->request->params['plugin'] == 'lil_invoices') {
         App::uses('HtmlHelper', 'View/Helper');
         $Html = new HtmlHelper($view);
         $Html->css('/lil_invoices/css/lil_invoices.css', null, array('inline' => false));
     }
     return true;
 }
开发者ID:malamalca,项目名称:lil-documents,代码行数:17,代码来源:LilInvoicesPluginController.php

示例3: _addScripts

 /**
  * _addScripts method
  *
  * Adds properties
  *
  * @param mixed $view
  * @return boolean
  */
 public function _addScripts($view)
 {
     if ($this->request->params['plugin'] == 'lil_tasks' || $this->request->params['plugin'] == 'lil' && $this->request->params['action'] == 'admin_dashboard') {
         App::uses('HtmlHelper', 'View/Helper');
         $Html = new HtmlHelper($view);
         $Html->css('/lil_tasks/css/lil_tasks.css', null, array('inline' => false));
         $Html->script('/lil_tasks/js/lil_tasks.js');
     }
     return true;
 }
开发者ID:malamalca,项目名称:lil-tasks,代码行数:18,代码来源:LilTasksPluginController.php

示例4: HtmlHelper

 function __toString()
 {
     $help = new HtmlHelper();
     $html = $help->css('/admin/custom/formtabs.css') . $help->javascript('/admin/custom/formtabs.js');
     $html .= '<div id="tabs">';
     foreach ($this->tabs as $tab) {
         $html .= $help->absoluteLink($tab[0], '#' . $tab[1]);
     }
     $html .= '<div class="clear"></div></div>';
     $html .= $this->getClientValidationHtml();
     return $html;
 }
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:12,代码来源:formtabs.input.php

示例5: css

 public function css($path, $rel = null, $options = array())
 {
     $options += array('assetFilter' => true);
     if (!$options['assetFilter']) {
         $__backup = Configure::read('Asset.filter.css');
         Configure::write('Asset.filter.css', null);
     }
     unset($options['assetFilter']);
     $result = parent::css($path, $rel, $options);
     if (isset($__backup)) {
         Configure::write('Asset.filter.css', $__backup);
     }
     return $result;
 }
开发者ID:hiromi2424,项目名称:ninja,代码行数:14,代码来源:ninja_html.php

示例6: HtmlHelper

 function __toString()
 {
     if ($this->countElements() < $this->min_inputs) {
         for ($i = 0; $i < $this->min_inputs - $this->countElements(); $i++) {
             $this->add();
         }
     }
     $html = new HtmlHelper();
     $output = $html->javascript('/widgets/custom/textlist.js');
     $output .= $html->css('/widgets/custom/textlist.css');
     $output .= '<div class="phaxsi-textlist" data-max="' . $this->max_inputs . '" data-callback="' . $this->on_insert . '" data-name="' . $this->_name . '">';
     $output .= '<div>' . $this->toString() . '</div>';
     $output .= $this->max_inputs == 0 || count($this->_elements) < $this->max_inputs ? $html->absoluteLink($this->link_text, 'javascript:void(0)', '') : '';
     $output .= '</div>';
     return $output;
 }
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:16,代码来源:textlist.input.php

示例7: css

 /**
  * Include Zuluru-specific CSS files from the configured location.
  * This replicates a bare minimum of the main HtmlHelper's css function,
  * to avoid prefixing absolute paths. Everything else is passed to the
  * parent for processing.
  */
 function css($path, $rel = null, $options = array())
 {
     $base = Configure::read('urls.zuluru_css');
     if (is_array($path)) {
         $paths = array();
         foreach ($path as $i) {
             $paths[] = $this->css($i, $rel, $options);
         }
         return implode("\n", $paths);
     }
     if (strpos($path, '://') !== false) {
         $url = $path;
     } else {
         if ($path[0] !== '/') {
             $url = $base . $path;
         }
     }
     return parent::css($url, $rel, $options);
 }
开发者ID:roboshed,项目名称:Zuluru,代码行数:25,代码来源:zuluru_html.php

示例8: scriptsForLayout

 public function scriptsForLayout($type = null)
 {
     $scripts = '';
     $files = $this->Baklava->getCombined();
     foreach ($files as $t => $file) {
         if ($type && $type != $t) {
             continue;
         }
         switch ($t) {
             case 'css':
                 $scripts .= parent::css($file, null, array('inline' => true));
                 break;
             case 'js':
                 $scripts .= parent::script($file, array('inline' => true, 'defer' => true));
                 break;
             case 'style':
                 $scripts .= parent::tag('style', $file, array('type' => 'text/css'));
                 break;
         }
     }
     return $scripts;
 }
开发者ID:0x20h,项目名称:Baklava,代码行数:22,代码来源:BaklavaHtmlHelper.php

示例9: twitter_login_button

/**
 * Template code for including the twitter login button into the theme
 *
 * @param boolean $display_if_logged_in
 * @return html|string
 */
function twitter_login_button($display_if_logged_in = true)
{
    //initializing variables
    App::import('Helper', 'Session');
    $Session = new SessionComponent();
    $auth = $Session->read('Auth');
    //reasons to fail
    if (twitter('profile.id', null, false)) {
        return false;
    }
    if (!$display_if_logged_in && isset($auth['User']['id'])) {
        return false;
    }
    // The same as require('controllers/users_controller.php');
    App::import('Helper', 'Html');
    $html = new HtmlHelper();
    $html->css('/twitterlogin/css/style.css', 'stylesheet', array('inline' => false));
    echo "<a href='" . Router::url(array('admin' => false, 'plugin' => null, 'controller' => 'twitterlogin', 'action' => 'authorize'), true) . "'><div class='twitter-login-lighter'></div></a>";
}
开发者ID:Jonathonbyrd,项目名称:Croogo-Twitter-Login,代码行数:25,代码来源:twitterlogin.php

示例10: css

 /** 
  * Concrete5's default behavior expects $file to be a string; so we can send it an array to override the default 
  * behavior and use our own solution; all the while remaining backwards-compatible with other Concrete5 functionality.
  * 
  * $file as an array can contain any of the following optional items:
  *		$url		// STRING (relative or absolute link to the file)
  *		$script		// STRING (the actual js code)
  *		$css		// STRING (the actual css code)
  *		$media		// STRING (media attribute value for <style> tag)
  *		$inline		// BOOL 
  *		$minify		// BOOL (minify the code first?) 
  *		$IE			// BOOL (surround in IE conditional comments?)
  *		$IEversion	// STRING (IE's condition to check i.e. 'lte IE 6')
  *		$fullTag	// STRING (if tag has already been assembled, but needs to be added to document)
  *		$fixRelativeLinks // BOOL (should we fix relative links inside the CSS? Only works for $inline=true. Defaults to true.
  * 
  * Example Usage:
  * 		$this->addHeaderItems($html->css(array(
  * 			'url' => 'styles/page_IE.css',
  * 			'inline' => true,
  * 			'minify' => true,
  * 			'IE' => true,
  * 			'IEversion' => 'lte IE 6'
  * 		)));
  */
 public function css($file, $pkgHandle = null)
 {
     if (!is_array($file)) {
         // Use default behavior
         return parent::css($file, $pkgHandle);
     } else {
         // Override the default behavior
         $css = new V2CSSOutputObject();
         // create a new variable name so it's not so confusing...
         $args = $file;
         // apply any submitted arguments to the CSSOutputObject
         if (isset($args['url'])) {
             $css->url = $args['url'];
         }
         if (isset($args['css'])) {
             $css->css = $args['css'];
         }
         if (isset($args['media'])) {
             $css->media = $args['media'];
         }
         if (isset($args['inline'])) {
             $css->inline = $args['inline'];
         }
         if (isset($args['minify'])) {
             $css->minify = $args['minify'];
         }
         if (isset($args['IE'])) {
             $css->IE = $args['IE'];
         }
         if (isset($args['IEversion'])) {
             $css->IEversion = $args['IEversion'];
         }
         if (isset($args['fullTag'])) {
             $css->fullTag = $args['fullTag'];
         }
         if (isset($args['fixRelativeLinks'])) {
             $css->fixRelativeLinks = $args['fixRelativeLinks'];
         }
         // Validate URLs to see if they match a local file
         if ($css->url && !preg_match('/^http:/', $css->url) && !strstr($css->url, '../')) {
             // for relative links only... and for security reasons, don't allow ../ in the url
             // The following code blocks are mostly copied straight from the CORE HtmlHelper
             $v = View::getInstance();
             if ($v->getThemeDirectory() != '' && file_exists($v->getThemeDirectory() . '/' . $css->url)) {
                 // checking the theme directory for it. It's just in the root.
                 $css->file = $v->getThemePath() . '/' . $css->url;
                 $css->rel = $v->getThemePath() . '/';
                 $css->abs = $v->getThemeDirectory() . '/' . $css->url;
             } else {
                 if ($pkgHandle != null) {
                     if (file_exists(DIR_BASE . '/' . DIRNAME_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_CSS . '/' . $css->url)) {
                         $css->file = DIR_REL . '/' . DIRNAME_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_CSS . '/' . $css->url;
                         $css->rel = DIR_REL . '/' . DIRNAME_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_CSS . '/';
                         $css->abs = DIR_BASE . '/' . DIRNAME_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_CSS . '/' . $css->url;
                     } else {
                         if (file_exists(DIR_BASE_CORE . '/' . DIRNAME_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_CSS . '/' . $css->url)) {
                             $css->file = ASSETS_URL . '/' . DIRNAME_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_CSS . '/' . $css->url;
                             $css->rel = ASSETS_URL . '/' . DIRNAME_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_CSS . '/';
                             $css->abs = DIR_BASE_CORE . '/' . DIRNAME_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_CSS . '/' . $css->url;
                         }
                     }
                 }
             }
             if ($css->file == '') {
                 if (file_exists(DIR_BASE . '/' . DIRNAME_CSS . '/' . $css->url)) {
                     $css->file = DIR_REL . '/' . DIRNAME_CSS . '/' . $css->url;
                     $css->rel = DIR_REL . '/' . DIRNAME_CSS . '/';
                     $css->abs = DIR_BASE . '/' . DIRNAME_CSS . '/' . $css->url;
                 } elseif (file_exists(DIR_BASE . '/' . DIRNAME_APP . '/' . DIRNAME_CSS . '/' . $css->url)) {
                     // this works but it's not good to hard-code it in.
                     $css->file = ASSETS_URL_CSS . '/' . $css->url;
                     $css->rel = ASSETS_URL_CSS . '/';
                     $css->abs = DIR_BASE . '/' . DIRNAME_APP . '/' . DIRNAME_CSS . '/' . $css->url;
                 } elseif (file_exists(DIR_BASE . '/' . $css->url)) {
                     $css->file = DIR_REL . '/' . $css->url;
//.........这里部分代码省略.........
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:101,代码来源:v2.php

示例11: getHeadHtml

 protected function getHeadHtml()
 {
     $html = new HtmlHelper($this->context);
     $output = '';
     foreach ($this->metas as $meta) {
         if ($meta['name']) {
             $output .= "<meta name=\"{$meta['name']}\" content=\"" . HtmlHelper::escape($meta['content']) . "\" />\r\n";
         } elseif ($meta['http-equiv']) {
             $output .= "<meta http-equiv=\"{$meta['http-equiv']}\" content=\"" . HtmlHelper::escape($meta['content']) . "\" />\r\n";
         }
     }
     $output .= "<title>" . HtmlHelper::escape($this->title) . "</title>\r\n";
     $output .= '<base href="' . UrlHelper::get('/') . '"/>' . "\r\n";
     if ($this->favico) {
         $output .= '<link rel="icon" type="' . $this->favico[1] . "\" href=\"" . UrlHelper::resource($this->favico[0]) . "\">\r\n";
     }
     if ($this->description) {
         $output .= '<meta name="description" content="' . HtmlHelper::escape($this->description) . "\" />\r\n";
     }
     if ($this->keywords) {
         $output .= '<meta name="keywords" content="' . HtmlHelper::escape($this->keywords) . "\" />\r\n";
     }
     foreach ($this->feeds as $feed) {
         $output .= '<link rel="alternate" type="application/rss+xml" title="RSS" href="' . UrlHelper::get($feed) . "\" />\r\n";
     }
     foreach ($this->styles as $style) {
         $output .= $html->css($style[0], $style[1]) . "\r\n";
     }
     if ($this->js_library) {
         $output .= "<script type=\"text/javascript\" src=\"{$this->js_library}\"></script>\r\n";
         $output .= $html->javascript('/' . APPU_PHAXSI . '/' . 'phaxsi-' . PhaxsiConfig::FRAMEWORK_VERSION . (AppConfig::DEBUG_MODE ? '' : '.min') . '.js') . "\r\n";
         $output .= HtmlHelper::inlineJavascript("Phaxsi.path = {" . "base: '" . UrlHelper::get('') . "'," . "local: '" . UrlHelper::localized('/') . "'," . "'public': '" . APPU_PUBLIC . "'," . "lang: '" . Lang::getCurrent() . "'}");
     }
     foreach ($this->scripts as $script) {
         $output .= $html->javascript($script) . "\r\n";
     }
     $this->styles = $this->scripts = array();
     return $output;
 }
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:39,代码来源:layout.class.php

示例12: css

 /**
  * Load CSS for the current page
  *
  * @param array $path 	 Names of CSS for the current page
  * @param array $options Options for the css element
  * @return string 		 A link tag for the head element
  */
 public function css($path = array(), $options = array())
 {
     $out = parent::css($this->pathCSS);
     if ($this->faLoad) {
         $out .= parent::css($this->faPath);
     }
     if ($this->bsAddonLoad) {
         $out .= parent::css($this->bsAddonPath);
     }
     // Others CSS
     foreach ($path as $css) {
         $out .= parent::css($css, $options);
     }
     return $out;
 }
开发者ID:xhs345,项目名称:CakePHP-BsHelpers,代码行数:22,代码来源:BsHelper.php


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