-
Notifications
You must be signed in to change notification settings - Fork 34
functions_essentials_resources
Initializes the resources essential.
Definition: public function resources_init()
Returns: void
Checks if a resource exists and returns it if so.
Definition: public function resourceExists($filename, $return_url=false, $as_local_path=false, $nocache=false)
Returns: string Depending on $return_url returns: (the resource URL or false on error) OR (true or false)
Parameters:
-
string $filenameThe resource name -
bool $return_urlIf true returns an URL, else returns true or false depending on if the resource exists -
bool $as_local_pathIf true returns not URL, but a filepath in local filesystem. Needs $return_url=true. -
bool $nocacheIf true skips all internal caches and peforms a search now
Returns aresource file, as local path or as URI.
Definition: public function resFile($filename, $as_local_path=false)
Returns: string An URL to the resource or the local file path. FALSE on error.
Parameters:
-
string $filenameThe resource filename (relative or name only) -
bool $as_local_pathIf true returns no URL, but a local path
Registers a variable for use in LESS files.
Definition: public function register_less_variable($name, $value)
Returns: void
Parameters:
-
string $nameVariable name -
string $valueVariable value
Adds a folder to the LESS search path.
Definition: public function add_less_import_dir($dir, $key=false)
Returns: void
Parameters:
-
string $dirFolder to be added -
mixed $keyIf given names this folder, so that it can be overwritten by another call to add_less_import_dir
Clears the LESS cache.
Definition: public function clear_less_cache()
Returns: void
Compiles LESS code to CSS.
Definition: public function compile_less_code($less, $use_vars=false)
Returns: string The compiled CSS code
Parameters:
-
string $lessThe LESS code -
bool $use_varsSwitch if defined variables should be used (default: true).