-
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 $filename
The resource name -
bool $return_url
If true returns an URL, else returns true or false depending on if the resource exists -
bool $as_local_path
If true returns not URL, but a filepath in local filesystem. Needs $return_url=true. -
bool $nocache
If 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 $filename
The resource filename (relative or name only) -
bool $as_local_path
If 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 $name
Variable name -
string $value
Variable value
Adds a folder to the LESS search path.
Definition: public function add_less_import_dir($dir, $key=false)
Returns: void
Parameters:
-
string $dir
Folder to be added -
mixed $key
If 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 $less
The LESS code -
bool $use_vars
Switch if defined variables should be used (default: true).