Example #1
0
 public static function clean($filename = null)
 {
     static::filename($filename);
     static::$description = static::$keywords = static::$title = static::$jsTextOnReady = '';
     static::$css = static::$js = static::$jsText = static::$jsMgr = [];
 }
Example #2
0
 /**
  * Remove a javascript asset, or all
  *
  * @param   mixed   Remove all if `NULL`, section if `TRUE` or `FALSE`, asset if `string`
  * @return  mixed   Empty array or void
  */
 public static function removeJs($handle = NULL)
 {
     if ($handle === NULL) {
         return static::$js = [];
     }
     if ($handle === TRUE or $handle === FALSE) {
         foreach (static::$js as $handle => $data) {
             if ($data['footer'] === $handle) {
                 unset(static::$js[$handle]);
             }
         }
         return;
     }
     unset(static::$js[$handle]);
 }
Example #3
0
 /**
  * Add javascript files to the array
  * @param array $files
  */
 public static function addJs(array $files)
 {
     static::$js = array_merge(static::$js, $files);
 }
Example #4
0
 public function getJsFiles()
 {
     static::$js = array_values(array_unique(static::$js));
     return static::$js;
 }