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 = []; }
/** * 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]); }
/** * Add javascript files to the array * @param array $files */ public static function addJs(array $files) { static::$js = array_merge(static::$js, $files); }
public function getJsFiles() { static::$js = array_values(array_unique(static::$js)); return static::$js; }