Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 public function init()
 {
     $this->builder = new ThemeHtmlBuilder($this->app['html'], $this->app['url']);
     StylistFacade::registerPath(__DIR__ . '/../Stubs/Themes/Parent');
     StylistFacade::activate('Parent theme');
 }