/** * Adds javascript and css files to Requirements based on their extension. If paths start with '/' then * goes from document root, otherwise from the Model installation path. * * @param string $when - look at before or after components. */ public static function add_requirements($when) { $installDir = ArtisanModule::get_module_path(); foreach (self::get_config_setting('requirements', $when) as $path) { if (substr($path, 0, 1) !== '/') { $path = Controller::join_links($installDir, $path); } $path = substr($path, 1); if (substr($path, -3, 3) === '.js') { Requirements::javascript($path); } if (substr($path, -4, 4) === '.css') { Requirements::css($path); } } }
public function ArtisanDir() { return ArtisanModule::get_module_path(); }