Exemple #1
0
 /**
  * Adds stylesheet
  *
  * @param string $file
  * @param string $ext
  * @param bool $template
  *
  * @return $this
  */
 public function addStylesheet($file, $ext = '.css', $template = false)
 {
     $url = $this->app->locateURL('css', $file . $ext);
     if (!$this->atk4_initialised || $template) {
         return parent::addStylesheet($file, $ext);
     }
     parent::addOnReady('$.atk4.includeCSS("' . $url . '")');
 }
Exemple #2
0
 /**
  * Adds static stylesheet
  *
  * @param string $file
  * @param string $ext
  * @param string $locate
  *
  * @return $this
  */
 public function addStaticStylesheet($file, $ext = '.css', $locate = 'css')
 {
     //$file=$this->app->locateURL('css',$file.$ext);
     if (@$this->included[$locate . '-' . $file . $ext]++) {
         return;
     }
     if (strpos($file, 'http') !== 0 && $file[0] != '/') {
         $url = $this->app->locateURL($locate, $file . $ext);
     } else {
         $url = $file;
     }
     $this->app->template->appendHTML('js_include', '<link type="text/css" href="' . $url . '" rel="stylesheet" />' . "\n");
     return $this;
 }