style() 공개 메소드

Generate a link to a CSS file.
public style ( string $url, array $attributes = [], boolean $secure = null ) : Illuminate\Support\HtmlString
$url string
$attributes array
$secure boolean
리턴 Illuminate\Support\HtmlString
예제 #1
0
 /**
  * Generate a link to a CSS file. With Stylist, this could actually generate
  * numerous style tags, due to CSS inheritance requirements.
  *
  * @param  string  $url
  * @param  array   $attributes
  * @param  bool    $secure
  * @return string
  */
 public function style($url, $attributes = array(), $secure = null)
 {
     $styles = [];
     $theme = StylistFacade::current();
     // If our theme has a parent, we want its stylesheet, as well.
     // @todo: This is dog-ugly - need to figure out a better approach.
     if ($theme->hasParent()) {
         $parent = StylistFacade::get($theme->getParent());
         StylistFacade::activate($parent);
         $styles[] = $this->style($url, $attributes, $secure);
         StylistFacade::activate($theme);
     }
     $styles[] = $this->html->style($this->assetUrl($url), $attributes, $secure);
     return implode("\n", $styles);
 }
예제 #2
0
 /**
  * Generate a link to a CSS file.
  *
  * @param string $url
  * @param array $attributes
  * @param bool $secure
  * @return \Illuminate\Support\HtmlString 
  * @static 
  */
 public static function style($url, $attributes = array(), $secure = null)
 {
     return \Collective\Html\HtmlBuilder::style($url, $attributes, $secure);
 }