API Documentation
Namespaces
Table of Contents
- iis_config() : mixed
- IIS Start config helper
- iis_remember() : mixed|null
- Cache return value of callback if not already cached and return the contents
- iis_safe_get_input() : array<string|int, mixed>|string
- Escape input recursively
- iis_safe_get() : null|string
- Return a safe GET value with an optional default value.
- iis_active_class() : void
- Echo an "active"-class if the comparison is true, otherwise an empty string.
- iis_active() : bool|string|void
- Echo a string if the comparison is true, otherwise empty string
- iis_vite_dev_server_url() : string
- Get the URL to the Vite dev server
- iis_vite_is_dev() : bool
- Check if the Vite dev server is running
- iis_vite_manifest() : array<string|int, mixed>|null
- Get the Vite manifest
- iis_vite_dev_script() : void
- Enqueue the Vite dev script
- iis_enqueue_vite_asset() : void
- Enqueue a Vite asset
- iis_enqueue_vite_script() : void
- Enqueue a Vite script
- iis_enqueue_vite_style() : void
- Enqueue a Vite style
- iis_vite() : void
- Enqueue the Vite assets
- iis_mix_manifest() : array<string|int, mixed>|null
- Get the laravel mix manifest
- iis_mix() : string|null
- Get the path to a versioned Mix file
- iis_get_hero() : array<string|int, mixed>|null
- Get the content hero
- iis_has_hero() : bool
- Checks if content starts with a hero
- iis_has_full_hero() : bool
- Checks if content starts with a full-width hero
- imns() : void|string
- Get and echo the styleguide namespace, set in .env-file of the theme
- iis_uses_styleguide() : bool
- Check if theme is using the styleguide
- iis_styleguide_sprite() : void
- Print IIS styleguide icon sprite
- iis_word_count() : false|int|null
- Count number of words in string.
- iis_get_reading_time() : float
- Get reading time for a string, in minutes.
- iis_get_post_reading_time() : float
- Get reading time for a post, in minutes.
- iis_get_images_reading_time() : int
- Calculate reading time for images in minutes.
Functions
iis_config()
IIS Start config helper
iis_config(string $keys[, mixed|null $fallback = null ][, string|null $directory = null ]) : mixed
Parameters
- $keys : string
-
the key to get the value for. Use dot notation for going deeper.
- $fallback : mixed|null = null
-
fallback if value is missing
- $directory : string|null = null
-
The directory where the config file is located.
Return values
mixed —The value (if found) for the given key.
iis_remember()
Cache return value of callback if not already cached and return the contents
iis_remember(string $cache_key, int $cache_time, callable $callback) : mixed|null
Parameters
- $cache_key : string
-
The name of the cached content.
- $cache_time : int
-
How long the content should be cached.
- $callback : callable
-
The callback that returns the content that should be cached.
Return values
mixed|null —iis_safe_get_input()
Escape input recursively
iis_safe_get_input(mixed $input) : array<string|int, mixed>|string
Parameters
- $input : mixed
-
Input parameter.
Return values
array<string|int, mixed>|string —iis_safe_get()
Return a safe GET value with an optional default value.
iis_safe_get(string $key[, null|string $default = null ]) : null|string
Parameters
- $key : string
-
The key for the $_GET array.
- $default : null|string = null
-
Default value if GET variable doesn't exist.
Return values
null|string —iis_active_class()
Echo an "active"-class if the comparison is true, otherwise an empty string.
iis_active_class(string $value[, string $compare_with = null ][, string $class = 'is-active' ][, bool $include_attr = true ]) : void
Parameters
- $value : string
-
The value to compare against.
- $compare_with : string = null
-
The value to compare with.
- $class : string = 'is-active'
-
The class that should be echoed if true.
- $include_attr : bool = true
-
True if class attribute should be included.
Return values
void —iis_active()
Echo a string if the comparison is true, otherwise empty string
iis_active(string $value[, string|array<string|int, mixed> $compare_with = null ][, string $attr = 'checked' ][, bool $echo = true ]) : bool|string|void
Parameters
- $value : string
-
The value to compare against.
- $compare_with : string|array<string|int, mixed> = null
-
The value to compare with.
- $attr : string = 'checked'
-
The attribute that should be echoed if $echo is true.
- $echo : bool = true
-
True if class attribute should be included.
Return values
bool|string|void —iis_vite_dev_server_url()
Get the URL to the Vite dev server
iis_vite_dev_server_url(string $path) : string
Parameters
- $path : string
-
The path to the asset
Return values
string —iis_vite_is_dev()
Check if the Vite dev server is running
iis_vite_is_dev() : bool
Return values
bool —iis_vite_manifest()
Get the Vite manifest
iis_vite_manifest() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null —iis_vite_dev_script()
Enqueue the Vite dev script
iis_vite_dev_script() : void
Return values
void —iis_enqueue_vite_asset()
Enqueue a Vite asset
iis_enqueue_vite_asset(string $handle, string $path[, string $type = 'script' ][, array<string|int, mixed> $deps = [] ][, bool $in_footer = true ]) : void
Parameters
- $handle : string
-
The handle for the script.
- $path : string
-
The path to the asset.
- $type : string = 'script'
-
The type of asset.
- $deps : array<string|int, mixed> = []
- $in_footer : bool = true
-
Whether to enqueue the script before