Grav System API

Table of contents


Class: \Grav\Common\Assets

Visibility Function
public __construct(array $options=array()) : void
Assets constructor.
public __toString() : string
public add(mixed $asset, int $priority=null, bool $pipeline=true) : \Grav\Common\$this
Add an asset or a collection of assets. It automatically detects the asset type (JavaScript, CSS or collection). You may add more than one asset passing an array as argument.
public addAsyncJs(mixed $asset, int $priority=null, bool $pipeline=true, string $group=null) : \Grav\Common\Assets
DEPRECATED - Please use dynamic method with ['loading' => 'async']
public addCss(mixed $asset, int $priority=null, bool $pipeline=true, string $group=null, string $loading=null) : \Grav\Common\$this
Add a CSS asset. It checks for duplicates. You may add more than one asset passing an array as argument. The second argument may alternatively contain an array of options which take precedence over positional arguments.
public addDeferJs(mixed $asset, int $priority=null, bool $pipeline=true, string $group=null) : \Grav\Common\Assets
DEPRECATED - Please use dynamic method with ['loading' => 'defer']
public addDir(string $directory, string $pattern='/.\.(css|js)$/i') : \Grav\Common\$this
Add all assets matching $pattern within $directory.
public addDirCss(string $directory) : \Grav\Common\$this
Add all CSS assets within $directory
public addDirJs(string $directory) : \Grav\Common\$this
Add all JavaScript assets within $directory
public addInlineCss(mixed $asset, int $priority=null, null $group=null) : \Grav\Common\$this
Add an inline CSS asset. It checks for duplicates. For adding chunks of string-based inline CSS
public addInlineJs(mixed $asset, int $priority=null, string $group=null) : \Grav\Common\$this
Add an inline JS asset. It checks for duplicates. For adding chunks of string-based inline JS
public addJs(mixed $asset, int $priority=null, bool $pipeline=true, string $loading=null, string $group=null) : \Grav\Common\$this
Add a JavaScript asset. It checks for duplicates. You may add more than one asset passing an array as argument. The second argument may alternatively contain an array of options which take precedence over positional arguments.
public addTo(array $assembly, mixed $asset, int $priority=null, bool $pipeline=true, string $loading=null, string $group=null) : \Grav\Common\$this
Add an asset to its assembly. It checks for duplicates. You may add more than one asset passing an array as argument. The third argument may alternatively contain an array of options which take precedence over positional arguments.
public config(array $config) : \Grav\Common\$this
Set up configuration options. All the class properties except 'js' and 'css' are accepted here. Also, an extra option 'autoload' may be passed containing an array of assets and/or collections that will be automatically added on startup.
public css(string $group='head', array $attributes=array()) : string
Build the CSS link tags.
public exists(mixed $asset) : bool
Determines if an asset exists as a collection, CSS or JS reference
public getCollections() : array
Return the array of all the registered collections
public getCss(null/string $key=null) : array
Return the array of all the registered CSS assets If a $key is provided, it will try to return only that asset else it will return null
public getJs(null/string $key=null) : array
Return the array of all the registered JS assets If a $key is provided, it will try to return only that asset else it will return null
public getQuerystring(mixed $asset) : string
public getTimestamp(bool $include_join=true) : string
Get the timestamp for assets
public init() : void
Initialization called in the Grav lifecycle to initialize the Assets with appropriate configuration
public js(string $group='head', array $attributes=array()) : string
Build the JavaScript script tags.
public registerCollection(string $collectionName, array $assets, bool $overwrite=false) : \Grav\Common\$this
Add/replace collection.
public removeCss(string $key) : void
Removes an item from the CSS array if set
public removeJs(string $key) : void
Removes an item from the JS array if set
public reset() : \Grav\Common\$this
Reset all assets.
public resetCss() : \Grav\Common\$this
Reset CSS assets.
public resetJs() : \Grav\Common\$this
Reset JavaScript assets.
public setCollection(mixed $collections) : void
Set the array of collections explicitly
public setCss(mixed $css) : void
Set the whole array of CSS assets
public setCssPipeline(boolean $value) : void
Sets the state of CSS Pipeline
public setJs(mixed $js) : void
Set the whole array of JS assets
public setJsPipeline(boolean $value) : void
Sets the state of JS Pipeline
public setTimestamp(mixed $value) : void
Explicitly set's a timestamp for assets
protected attributes(array $attributes) : string
Build an HTML attribute string from an array.
protected buildLocalLink(string $asset, bool $absolute=false) : string the final link url to the asset
Build local links including grav asset shortcodes
protected cssRewrite(string $file, string $relative_path) : mixed
Finds relative CSS urls() and rewrites the URL with an absolute one
protected gatherLinks(array $links, bool $css=true) : string
Download and concatenate the content of several links.
protected getLastModificationTime(string $asset) : string the last modifcation time or false on error
Get the last modification time of asset
protected isRemoteLink(string $link) : bool
Determine whether a link is local or remote. Understands both "http://" and "https://" as well as protocol agnostic links "//"
protected moveImports(string $file) : string the modified file with any @imports at the top of the file
Moves @import statements to the top of the file per the CSS specification
protected pipelineCss(string $group='head', bool $returnURL=true) : bool/string URL or generated content if available, else false
Minify and concatenate CSS
protected pipelineJs(string $group='head', bool $returnURL=true) : bool/string URL or generated content if available, else false
Minify and concatenate JS files.
protected rglob(string $directory, string $pattern, string $ltrim=null) : array
Recursively get files matching $pattern within $directory.
protected sortAssetsByPriorityThenOrder(mixed $a, mixed $b) : mixed


Class: \Grav\Common\Browser

Internally uses the PhpUserAgent package https://github.com/donatj/PhpUserAgent

Visibility Function
public __construct() : void
Browser constructor.
public getBrowser() : string the lowercase browser name
Get the current browser identifier Currently detected browsers: Android Browser BlackBerry Browser Camino Kindle / Silk Firefox / Iceweasel Safari Internet Explorer IEMobile Chrome Opera Midori Vivaldi TizenBrowser Lynx Wget Curl
public getLongVersion() : string the browser full version identifier
Get the current full version identifier
public getPlatform() : string the lowercase platform name
Get the current platform identifier Currently detected platforms: Desktop -> Windows -> Linux -> Macintosh -> Chrome OS Mobile -> Android -> iPhone -> iPad / iPod Touch -> Windows Phone OS -> Kindle -> Kindle Fire -> BlackBerry -> Playbook -> Tizen Console -> Nintendo 3DS -> New Nintendo 3DS -> Nintendo Wii -> Nintendo WiiU -> PlayStation 3 -> PlayStation 4 -> PlayStation Vita -> Xbox 360 -> Xbox One
public getVersion() : string the browser major version identifier
Get the current major version identifier
public isHuman() : bool
Determine if the request comes from a human, or from a bot/crawler


Class: \Grav\Common\Cache

The GravCache object is used throughout Grav to store and retrieve cached data. It uses DoctrineCache library and supports a variety of caching mechanisms. Those include: APCu APC XCache RedisCache MemCache MemCacheD FileSystem

Visibility Function
public __construct(\Grav\Common\Grav $grav) : void
Constructor
public static clearCache(string $remove='standard') : array
Helper method to clear all Grav caches
public contains(string $id) : bool true if the cached items exists
Returns a boolean state of whether or not the item exists in the cache based on id key
public delete(string $id) : bool true if the item was deleted successfully
Deletes an item in the cache based on the id
public fetch(string $id) : object/bool returns the cached entry, can be any type, or false if doesn't exist
Gets a cached entry if it exists based on an id. If it does not exist, it returns false
public getCacheDriver() : DoctrineCache\CacheProvider The cache driver to use
Automatically picks the cache mechanism to use. If you pick one manually it will use that If there is no config option for $driver in the config, or it's set to 'auto', it will pick the best option based on which cache extensions are installed.
public getCacheStatus() : string
Get cache state
public getDriverName() : mixed
Returns the current driver name
public getDriverSetting() : mixed
Returns the current driver setting
public getEnabled() : bool
Returns the current enabled state
public getKey() : mixed
Getter method to get the cache key
public getLifetime() : mixed
Retrieve the cache lifetime (in seconds)
public init(\Grav\Common\Grav $grav) : void
Initialization that sets a base key and the driver based on configuration settings
public isVolatileDriver(mixed $setting) : bool
is this driver a volatile driver in that it resides in PHP process memory
public save(string $id, array/object $data, int $lifetime=null) : void
Stores a new cached entry.
public setEnabled(mixed $enabled) : void
Public accessor to set the enabled state of the cache
public setKey(mixed $key) : void
Setter method to set key (Advanced)
public setLifetime(int $future) : void
Set the cache lifetime programmatically

This class extends \Grav\Common\Getters

This class implements \Countable, \ArrayAccess


Class: \Grav\Common\Composer

Visibility Function
public static getComposerExecutor() : string
Return the composer executable file path
public static getComposerLocation() : string
Returns the location of composer.


Class: \Grav\Common\Debugger

Visibility Function
public __construct() : void
Debugger constructor.
public addAssets() : \Grav\Common\$this
Add the debugger assets to the Grav Assets
public addCollector(mixed $collector) : \Grav\Common\$this
Adds a data collector
public addException(\Exception $e) : \Grav\Common\Debugger
Dump exception into the Messages tab of the Debug Bar
public addMessage(mixed $message, string $label='info', bool $isString=true) : \Grav\Common\$this
Dump variables into the Messages tab of the Debug Bar
public enabled(bool $state=null) : null
Set/get the enabled state of the debugger
public getCaller(mixed $ignore=2) : mixed
public getCollector(mixed $collector) : \DebugBar\DataCollector\DataCollectorInterface
Returns a data collector
public init() : \Grav\Common\$this
Initialize the debugger
public render() : \Grav\Common\$this
Displays the debug bar
public sendDataInHeaders() : \Grav\Common\$this
Sends the data through the HTTP headers
public startTimer(mixed $name, string/null $description=null) : \Grav\Common\$this
Start a timer with an associated name and description
public stopTimer(string $name) : \Grav\Common\$this
Stop the named timer


Class: \Grav\Common\Getters (abstract)

Visibility Function
public __get(mixed $offset) : mixed Medium value
Magic getter method
public __isset(mixed $offset) : boolean True if the value is set
Magic method to determine if the attribute is set
public __set(mixed $offset, mixed $value) : void
Magic setter method
public __unset(mixed $offset) : void
Magic method to unset the attribute
public count() : int
public offsetExists(mixed $offset) : bool
public offsetGet(mixed $offset) : mixed
public offsetSet(mixed $offset, mixed $value) : void
public offsetUnset(mixed $offset) : void
public toArray() : array
Returns an associative array of object properties.

This class implements \ArrayAccess, \Countable


Class: \Grav\Common\Grav

Visibility Function
public __call(mixed $method, mixed $args) : void
Magic Catch All Function Used to call closures like measureTime on the instance. Source: http://stackoverflow.com/questions/419804/closures-as-class-members
public fallbackUrl(mixed $path) : void
This attempts to find media, other files, and download them
public fireEvent(string $eventName, \RocketTheme\Toolbox\Event\Event $event=null) : \RocketTheme\Toolbox\Event\Event
Fires an event with optional parameters.
public header() : void
Set response header.
public static instance(array $values=array()) : \Grav\Common\Grav
Return the Grav instance. Create it if it's not already instanced
public process() : void
Process a request
public redirect(string $route, int $code=null) : void
Redirect browser to another location.
public redirectLangSafe(string $route, int $code=null) : void
Redirect browser to another location taking language into account (preferred)
public static resetInstance() : void
Reset the Grav instance.
public setLocale() : void
Set the system locale based on the language and configuration
public shutdown() : void
Set the final content length for the page and flush the buffer
protected static load(array $values) : \Grav\Common\static
Initialize and return a Grav instance
protected registerService(string $serviceKey, string $serviceClass) : void
Register a service with the container.
protected registerServiceProvider(string $serviceClass) : void
Register a service provider with the container.
protected registerServices() : void
Register all services Services are defined in the diMap. They can either only the class of a Service Provider or a pair of serviceKey => serviceClass that gets directly mapped into the container.

This class extends \RocketTheme\Toolbox\DI\Container

This class implements \ArrayAccess


Class: \Grav\Common\Inflector

This file was originally part of the Akelos Framework

Visibility Function
public camelize(string $word) : string UpperCamelCasedWord
Returns given word as CamelCased Converts a word like "send_email" to "SendEmail". It will remove non alphanumeric character from the word, so "who's online" will be converted to "WhoSOnline"
public classify(string $table_name) : string SingularClassName
Converts a table name to its class name according to rails naming conventions. Converts "people" to "Person"
public humanize(string $word, string $uppercase='') : string Human-readable word
Returns a human-readable string from $word Returns a human-readable string from $word, by replacing underscores with a space, and by upper-casing the initial character by default. If you need to uppercase all the words you just have to pass 'all' as a second parameter. instead of just the first one.
public hyphenize(string $word) : string hyphenized word
Converts a word "into-it-s-hyphenated-version" Convert any "CamelCased" or "ordinary Word" into an "hyphenated-word". This can be really useful for creating friendly URLs.
public init() : void
public monthize(int $days) : int
Converts a number of days to a number of months
public ordinalize(integer $number) : string Ordinal representation of given string.
Converts number to its ordinal English form. This method converts 13 to 13th, 2 to 2nd ...
public pluralize(string $word, int $count=2) : string Plural noun
Pluralizes English nouns.
public singularize(string $word, int $count=1) : string Singular noun.
Singularizes English nouns.
public tableize(string $class_name) : string plural_table_name
Converts a class name to its table name according to rails naming conventions. Converts "Person" to "people"
public titleize(string $word, string $uppercase='') : string Text formatted as title
Converts an underscored or CamelCase word into a English sentence. The titleize public function converts text like "WelcomePage", "welcome_page" or "welcome page" to this "Welcome Page". If second parameter is set to 'first' it will only capitalize the first character of the title. first character. Otherwise it will uppercase all the words in the title.
public underscorize(string $word) : string Underscored word
Converts a word "into_it_s_underscored_version" Convert any "CamelCased" or "ordinary Word" into an "underscored_word". This can be really useful for creating friendly URLs.
public variablize(string $word) : string Returns a lowerCamelCasedWord
Same as camelize but first char is underscored Converts a word like "send_email" to "sendEmail". It will remove non alphanumeric character from the word, so "who's online" will be converted to "whoSOnline"


Class: \Grav\Common\Iterator

Visibility Function
public __call(string $key, mixed $args) : mixed
Convert function calls for the existing keys into their values.
public __clone() : void
Clone the iterator.
public __construct(array $items=array()) : void
Constructor to initialize array.
public __get(mixed $offset) : mixed Asset value
Magic getter method
public __isset(mixed $offset) : boolean True if the value is set
Magic method to determine if the attribute is set
public __set(mixed $offset, mixed $value) : void
Magic setter method
public __toString() : string
Convents iterator to a comma separated list.
public __unset(mixed $offset) : void
Magic method to unset the attribute
public append(array/\Grav\Common\Iterator $items) : \Grav\Common\$this
Append new elements to the list.
public count() : int
Implements Countable interface.
public current() : mixed Can return any type.
Returns the current element.
public filter(\callable $callback=null) : \Grav\Common\$this
Filter elements from the list filter status
public first() : mixed
Get the first item
public indexOf(mixed $needle) : string/bool Key if found, otherwise false.
public key() : mixed Returns scalar on success, or NULL on failure.
Returns the key of the current element.
public last() : mixed
Get the last item
public next() : void
Moves the current position to the next element.
public nth(int $key) : mixed/bool
Return nth item.
public offsetExists(mixed $offset) : bool Returns TRUE on success or FALSE on failure.
Whether or not an offset exists.
public offsetGet(mixed $offset) : mixed Can return all value types.
Returns the value at specified offset.
public offsetSet(mixed $offset, mixed $value) : void
Assigns a value to the specified offset.
public offsetUnset(mixed $offset) : void
Unsets an offset.
public prev() : mixed
Return previous item.
public random(int $num=1) : \Grav\Common\$this
Pick one or more random entries.
public remove(mixed $key) : void
Remove item from the list.
public reverse() : \Grav\Common\$this
Reverse the Iterator
public rewind() : void
Rewinds back to the first element of the Iterator.
public serialize() : string Returns the string representation of the object.
Returns string representation of the object.
public shuffle() : \Grav\Common\$this
Shuffle items.
public slice(int $offset, int $length=null) : \Grav\Common\$this
Slice the list.
public sort(\callable $callback=null, bool $desc=false) : \Grav\Common\$this/array
Sorts elements from the list and returns a copy of the list in the proper order
public toArray() : array
Convert object into an array.
public toJson() : string
Convert object into JSON string.
public toYaml(int $inline=3, int $indent=2) : string A YAML string representing the object.
Convert object into YAML string.
public unserialize(string $serialized) : void
Called during unserialization of the object.
public valid() : bool Returns TRUE on success or FALSE on failure.
This method is called after Iterator::rewind() and Iterator::next() to check if the current position is valid.

This class implements \ArrayAccess, \Iterator, \Traversable, \Countable, \Serializable


Class: \Grav\Common\Plugin

Visibility Function
public __construct(string $name, \Grav\Common\Grav $grav, \Grav\Common\Config\Config $config=null) : void
Constructor.
public config() : \Grav\Common\Config\Config
Get configuration of the plugin.
public getBlueprint() : mixed
Simpler getter for the plugin blueprint
public static getSubscribedEvents() : array
By default assign all methods as listeners using the default priority.
public isAdmin() : bool
Determine if this is running under the admin
public offsetExists(mixed $offset) : bool Returns TRUE on success or FALSE on failure.
Whether or not an offset exists.
public offsetGet(mixed $offset) : mixed Can return all value types.
Returns the value at specified offset.
public offsetSet(mixed $offset, mixed $value) : void
Assigns a value to the specified offset.
public offsetUnset(mixed $offset) : void
Unsets an offset.
public static saveConfig(string $plugin_name) : true
Persists to disk the plugin parameters currently stored in the Grav Config object
public setConfig(\Grav\Common\Config\Config $config) : \Grav\Common\$this
protected disable(array $events) : void
protected enable(array $events) : void
protected isPluginActiveAdmin(mixed $plugin_route) : bool
Determine if this route is in Admin and active for the plugin
protected loadBlueprint() : mixed
Load blueprints.
protected mergeConfig(\Grav\Common\Page\Page $page, bool/mixed $deep=false, array $params=array(), string $type='plugins') : \Grav\Common\Data\Data
Merge global and page configurations. plugin settings. merge with the plugin settings.
protected parseLinks(string $content, callable $function, string $internal_regex='(.*)') : string
This function will search a string for markdown links in a specific format. The link value can be optionally compared against via the $internal_regex and operated on by the callback $function provided. format: plugin:myplugin_name

This class implements \RocketTheme\Toolbox\Event\EventSubscriberInterface, \Symfony\Component\EventDispatcher\EventSubscriberInterface, \ArrayAccess


Class: \Grav\Common\Plugins

Visibility Function
public __construct() : void
public add(mixed $plugin) : void
Add a plugin
public static all() : array
Return list of all plugin data with their blueprints.
public static get(string $name) : \Grav\Common\Data/null
Get a plugin by name
public init() : array/Plugin[] array of Plugin objects
Registers all plugins.
public setup() : \Grav\Common\$this
protected loadPlugin(mixed $name) : mixed

This class extends \Grav\Common\Iterator

This class implements \Serializable, \Countable, \Traversable, \Iterator, \ArrayAccess


Class: \Grav\Common\Session

Visibility Function
public __construct(\Grav\Common\Grav $grav) : void
Session constructor.
public getFlashObject(mixed $name) : mixed
public init() : void
Session init
public setFlashObject(mixed $name, mixed $object) : void

This class extends \RocketTheme\Toolbox\Session\Session

This class implements \Traversable, \IteratorAggregate


Class: \Grav\Common\Taxonomy

The Taxonomy object is a singleton that holds a reference to a 'taxonomy map'. This map is constructed as a multidimensional array. uses the taxonomy defined in the site.yaml file and is built when the page objects are recursed. Basically every time a page is found that has taxonomy references, an entry to the page is stored in the taxonomy map. The map has the following format: [taxonomy_type][taxonomy_value][page_path] For example: [category][blog][path/to/item1] [tag][grav][path/to/item1] [tag][grav][path/to/item2] [tag][dog][path/to/item3]

Visibility Function
public __construct(\Grav\Common\Grav $grav) : void
Constructor that resets the map
public addTaxonomy(\Grav\Common\Page\Page $page, array $page_taxonomy=null) : void
Takes an individual page and processes the taxonomies configured in its header. It then adds those taxonomies to the map
public findTaxonomy(array $taxonomies, string $operator='and') : Collection Collection object set to contain matches found in the taxonomy map
Returns a new Page object with the sub-pages containing all the values set for a particular taxonomy.
public getTaxonomyItemKeys(string $taxonomy) : array keys of this taxonomy
Gets item keys per taxonomy
public taxonomy(array $var=null) : array the taxonomy map
Gets and Sets the taxonomy map


Class: \Grav\Common\Theme

Visibility Function
public __construct(\Grav\Common\Grav $grav, \Grav\Common\Config\Config $config, string $name) : void
Constructor.
public config() : \Grav\Common\Config\Config
Get configuration of the plugin.
public getBlueprint() : mixed
Simpler getter for the theme blueprint
public static saveConfig(string $theme_name) : true
Persists to disk the theme parameters currently stored in the Grav Config object
protected loadBlueprint() : mixed
Load blueprints.
protected mergeConfig(\Grav\Common\Page\Page $page, string $deep='merge', array $params=array(), string $type='themes') : void
Override the mergeConfig method to work for themes

This class extends \Grav\Common\Plugin

This class implements \ArrayAccess, \Symfony\Component\EventDispatcher\EventSubscriberInterface, \RocketTheme\Toolbox\Event\EventSubscriberInterface


Class: \Grav\Common\Themes

Visibility Function
public __construct(\Grav\Common\Grav $grav) : void
Themes constructor.
public all() : array
Return list of all theme data with their blueprints.
public configure() : void
Configure and prepare streams for current template.
public current() : string
Return name of the current theme.
public get(string $name) : \Grav\Common\Data\Data
Get theme configuration or throw exception if it cannot be found.
public init() : void
public initTheme() : void
public load() : \Grav\Common\Theme
Load current theme.
protected autoloadTheme(string $class) : mixed false FALSE if unable to load $class; Class name if $class is successfully loaded
Autoload theme classes for inheritance
protected loadConfiguration(string $name, \Grav\Common\Config\Config $config) : mixed
Load theme configuration.
protected loadLanguages(\Grav\Common\Config\Config $config) : mixed
Load theme languages.

This class extends \Grav\Common\Iterator

This class implements \Serializable, \Countable, \Traversable, \Iterator, \ArrayAccess


Class: \Grav\Common\Uri

Visibility Function
public __construct() : void
Constructor
public static addNonce(string $url, string $action, string $nonceParamName='nonce') : string the url with the nonce
Adds the nonce to a URL for a specific action
public base() : String The base of the URI
Return the base of the URI
public baseIncludingLanguage() : String The base of the URI
Return the base relative URL including the language prefix or the base relative url if multilanguage is not enabled
public basename() : String The basename of the URI
Return the basename of the URI
public static buildParams(mixed $params) : void
public static buildUrl(mixed $parsed_url) : string
The opposite of built-in PHP method parse_url()
public static convertUrl(\Grav\Common\Page\Page $page, string $url, string $type='link', bool $absolute=false, bool $route_only=false) : string the more friendly formatted url
Converts links from absolute '/' or relative (../..) to a Grav friendly format
public static convertUrlOld(\Grav\Common\Page\Page $page, string $markdown_url, string $type='link', null $relative=null) : string the more friendly formatted url
Converts links from absolute '/' or relative (../..) to a Grav friendly format
public currentPage() : int
Return current page number.
public environment() : String
Gets the environment name
public extension(null $default=null) : String The extension of the URI
Return the Extension of the URI
public static extractParams(mixed $uri, mixed $delimiter) : void
public fragment(null $fragment=null) : null
Gets the Fragment portion of a URI (eg #target)
public host() : String The host of the URI
Return the host of the URI
public init() : void
Initializes the URI object based on the url set on the object
public initializeWithUrl(string $url='') : string
Initialize the URI class with a url passed via parameter. Used for testing purposes.
public initializeWithUrlAndRootPath(string $url, string $root_path) : \Grav\Common\$this
Initialize the URI class by providing url and root_path arguments
public static ip() : string ip address
Return the IP address of the current user
public static isExternal(string $url) : boolean is eternal state
Is this an external URL? if it starts with http then yes, else false
public static isValidUrl(mixed $url) : bool
Is the passed in URL a valid URL?
public param(string $id) : bool/string
Get URI parameter.
public params(string $id=null, bool/boolean $array=false) : null/string
Return all or a single query parameter as a URI compatible string.
public static paramsRegex() : string
Calculate the parameter regex based on the param_sep setting
public static parseUrl(mixed $url) : void
public path() : String The path of the URI
Return the Path
public paths(string $id=null) : string
Return URI path.
public port() : int
Return the port number
public query(string $id=null, bool $raw=false) : string/array Returns an array if $id = null and $raw = true
Return full query string or a single query attribute.
public referrer(string $default=null, string $attributes=null) : string
Return relative path to the referrer defaulting to current or given page.
public rootUrl(bool $include_host=false) : mixed
Return root URL to the site.
public route(bool $absolute=false, bool $domain=false) : string
Return route to the current URI. By default route doesn't include base path.
public scheme() : String The scheme of the URI
Return the scheme of the URI
public url(bool $include_host=false) : string
Return URL.
public validateHostname(string $hostname) : boolean
Validate a hostname


Class: \Grav\Common\Utils (abstract)

Visibility Function
public static arrayFilterRecursive(array $source, callable $fn) : array
Recursively filter an array, filtering values by processing them through the $fn function argument
public static arrayFlatten(mixed $array) : array
Flatten an array
public static arrayMergeRecursiveUnique(mixed $array1, mixed $array2) : mixed
Recursive Merge with uniqueness
public static contains(string $haystack, string $needle) : bool
Check if the $haystack string contains the substring $needle
public static date2timestamp(string $date, string $format=null) : int the timestamp
Get the timestamp of a date strtotime argument
public static dateFormats() : array
Return the Grav date formats allowed
public static download(string $file, bool $force_download=true, int $sec, int $bytes=1024) : void
Provides the ability to download a file to the browser
public static endsWith(string $haystack, string $needle) : bool
Check if the $haystack string ends with the substring $needle
public static generateRandomString(int $length=5) : string
Generate a random string of a given length
public static getDotNotation(mixed $array, mixed $key, null $default=null) : mixed
Get a portion of an array (passed by reference) with dot-notation key
public static getExtensionByMime(string $mime, string $default='html') : string
Return the mimetype based on filename extension
public static getMimeByExtension(string $extension, string $default='application/octet-stream') : string
Return the mimetype based on filename extension
public static getNonce(string $action, bool $plusOneTick=false) : string the nonce
Creates a hashed nonce tied to the passed action. Tied to the current user and time. The nonce for a given action is the same for 12 hours.
public static getNonceOldStyle(mixed $action, bool $plusOneTick=false) : mixed
public static getPagePathFromToken(mixed $path, null $page=null) : string
Get's path based on a token
public static isAdminPlugin() : bool
Simple helper method to get whether or not the admin plugin is active
public static isApache() : bool
Utility to determine if the server running PHP is Apache
public static isFunctionDisabled(string $function) : bool
Check whether a function is disabled in the PHP settings
public static isPositive(string $value) : boolean
Checks if a value is positive
public static isWindows() : bool
Utility method to determine if the current OS is Windows
public static mergeObjects(object $obj1, object $obj2) : object
Merge two objects into one.
public static normalizePath(string $path) : string
Normalize path by processing relative . and .. syntax and merging path
public static pathPrefixedByLangCode(string $string) : bool
Checks if the passed path contains the language code prefix
public static resolve(array $array, mixed $path, mixed $default=null) : void
DEPRECATED - Use getDotNotation() method instead
public static safeTruncate(string $string, int $limit=150) : string
Truncate text by number of characters in a "word-safe" manor.
public static safeTruncateHtml(string $text, int $length=25, string $ellipsis='...') : string
Truncate HTML by number of characters in a "word-safe" manor.
public static setDotNotation(mixed $array, mixed $key, mixed $value, bool $merge=false) : mixed
Set portion of array (passed by reference) for a dot-notation key and set the value
public static startsWith(string $haystack, string $needle) : bool
Check if the $haystack string starts with the substring $needle
public static substrToString(mixed $haystack, mixed $needle) : string
Returns the substring of a string up to a specified needle. if not found, return the whole haytack
public static timezones() : array
Get the formatted timezones list
public static truncate(string $string, int $limit=150, bool $up_to_break=false, string $break=' ', string $pad='…') : string
Truncate text by number of characters but can cut off words.
public static truncateHtml(string $text, int $length=100, string $ellipsis='...') : string
Truncate HTML by number of characters. not "word-safe"!
public static verifyNonce(string $nonce, string $action) : boolean verified or not
Verify the passed nonce for the give action


Class: \Grav\Common\Backup\ZipBackup

Visibility Function
public static backup(null $destination=null, \callable $messager=null) : null/string
Backup


Class: \Grav\Common\Config\CompiledBase (abstract)

Visibility Function
public __construct(string $cacheFolder, array $files, string $path) : void
public checksum() : bool/string
Returns checksum from the configuration files. You can set $this->checksum = false to disable this check.
public load() : mixed
Load the configuration.
public modified() : void
Function gets called when cached configuration is saved.
public name(string $name=null) : \Grav\Common\Config\$this
Get filename for the compiled PHP file.
public timestamp() : int Timestamp of compiled configuration
Get timestamp of compiled configuration
protected createFilename() : mixed
protected abstract createObject(array $data=array()) : mixed
Create configuration object.
protected abstract finalizeObject() : void
Finalize configuration object.
protected getState() : mixed
protected loadCompiledFile(string $filename) : bool
Load compiled file.
protected abstract loadFile(string $name, string $filename) : mixed
Load single configuration file and append it to the correct position.
protected loadFiles() : bool
Load and join all configuration files.
protected saveCompiledFile(string $filename) : void
Save compiled file.


Class: \Grav\Common\Config\CompiledBlueprints

Visibility Function
public checksum() : bool/string
Returns checksum from the configuration files. You can set $this->checksum = false to disable this check.
protected createObject(array $data=array()) : mixed
Create configuration object.
protected finalizeObject() : void
Finalize configuration object.
protected getState() : mixed
protected getTypes() : array
Get list of form field types.
protected loadFile(string $name, array $files) : mixed
Load single configuration file and append it to the correct position.
protected loadFiles() : bool
Load and join all configuration files.

This class extends \Grav\Common\Config\CompiledBase


Class: \Grav\Common\Config\CompiledConfig

Visibility Function
public load(bool $withDefaults=false) : mixed
public modified() : void
Function gets called when cached configuration is saved.
public setBlueprints(\callable $blueprints) : \Grav\Common\Config\$this
Set blueprints for the configuration.
protected createObject(array $data=array()) : mixed
Create configuration object.
protected finalizeObject() : void
Finalize configuration object.
protected loadFile(string $name, string $filename) : mixed
Load single configuration file and append it to the correct position.

This class extends \Grav\Common\Config\CompiledBase


Class: \Grav\Common\Config\CompiledLanguages

Visibility Function
public modified() : void
Function gets called when cached configuration is saved.
protected createObject(array $data=array()) : mixed
Create configuration object.
protected finalizeObject() : void
Finalize configuration object.
protected loadFile(string $name, string $filename) : mixed
Load single configuration file and append it to the correct position.

This class extends \Grav\Common\Config\CompiledBase


Class: \Grav\Common\Config\Config

Visibility Function
public checksum(mixed $checksum=null) : void
public debug() : void
public getLanguages() : mixed
public init() : void
public key() : void
public modified(mixed $modified=null) : void
public reload() : void
public timestamp(mixed $timestamp=null) : void

This class extends \Grav\Common\Data\Data

This class implements \RocketTheme\Toolbox\ArrayTraits\ExportInterface, \Countable, \ArrayAccess, \Grav\Common\Data\DataInterface


Class: \Grav\Common\Config\ConfigFileFinder

Visibility Function
public getFiles(array $paths, string $pattern='|\.yaml$|', int $levels=-1) : array
Return all locations for all the files with a timestamp.
public listFiles(array $paths, string $pattern='|\.yaml$|', int $levels=-1) : array
Return all paths for all the files with a timestamp.
public locateFile(array $paths, string $name, string $ext='.yaml') : array
Return all existing locations for a single file with a timestamp.
public locateFileInFolder(string $filename, array $folders) : array
Find filename from a list of folders. Note: Only finds the last override.
public locateFiles(array $paths, string $pattern='|\.yaml$|', int $levels=-1) : array
Return all locations for all the files with a timestamp.
public locateInFolders(array $folders, string $filename=null) : array
Find filename from a list of folders.
public setBase(string $base) : \Grav\Common\Config\$this
protected detectAll(string $folder, string $pattern, int $levels) : array
Detects all plugins with a configuration file and returns them with last modification time.
protected detectInFolder(string $folder, string $lookup=null) : array
Detects all directories with the lookup file and returns them with last modification time.
protected detectRecursive(string $folder, string $pattern, int $levels) : array
Detects all directories with a configuration file and returns them with last modification time.


Class: \Grav\Common\Config\Languages

Visibility Function
public checksum(mixed $checksum=null) : void
public mergeRecursive(array $data) : void
public modified(mixed $modified=null) : void
public reformat() : void
public timestamp(mixed $timestamp=null) : void

This class extends \Grav\Common\Data\Data

This class implements \RocketTheme\Toolbox\ArrayTraits\ExportInterface, \Countable, \ArrayAccess, \Grav\Common\Data\DataInterface


Class: \Grav\Common\Config\Setup

Visibility Function
public __construct(\Grav\Common\Config\Container/array $container) : void
public getStreams() : array
Get available streams and their types from the configuration.
public init() : \Grav\Common\Config\$this
public initializeLocator(\RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator $locator) : void
Initialize resource locator by using the configuration.
protected check(\RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator $locator) : void

This class extends \Grav\Common\Data\Data

This class implements \RocketTheme\Toolbox\ArrayTraits\ExportInterface, \Countable, \ArrayAccess, \Grav\Common\Data\DataInterface


Class: \Grav\Common\Data\Blueprint

Visibility Function
public extra(array $data, string $prefix='') : array
Return data fields that do not exist in blueprints.
public filter(array $data) : array
Filter data by using blueprints.
public getDefaults() : array
Get nested structure containing default values defined in the blueprints. Fields without default value are ignored in the list.
public mergeData(array $data1, array $data2, string $name=null, string $separator='.') : array
Merge two arrays by using blueprints.
public schema() : \Grav\Common\Data\BlueprintSchema
Return blueprint data schema.
public setTypes(array $types) : \Grav\Common\Data\$this
Set default values for field types.
public validate(array $data) : void
Validate data against blueprints.
protected dynamicConfig(array $field, string $property, array $call) : void
protected dynamicData(array $field, string $property, array $call) : void
protected getFiles(string/array $path, string $context=null) : array
protected initInternals() : void
Initialize validator.
protected loadFile(string $filename) : string

This class extends \RocketTheme\Toolbox\Blueprints\BlueprintForm

This class implements \RocketTheme\Toolbox\ArrayTraits\ExportInterface, \ArrayAccess


Class: \Grav\Common\Data\Blueprints

Visibility Function
public __construct(string/string/array $search='blueprints://') : void
public get(string $type) : \Grav\Common\Data\Blueprint
Get blueprint.
public types() : array List of type=>name
Get all available blueprint types.
protected loadFile(string $name) : \Grav\Common\Data\Blueprint
Load blueprint file.


Class: \Grav\Common\Data\BlueprintSchema

Visibility Function
public filter(array $data) : array
Filter data by using blueprints.
public toArray() : array
Convert object into an array.
public toJson() : string
Convert object into JSON string.
public toYaml(int $inline=3, int $indent=2) : string A YAML string representing the object.
Convert object into YAML string.
public validate(array $data) : void
Validate data against blueprints.
protected checkRequired(array $data, array $fields) : array
protected dynamicConfig(array $field, string $property, array $call) : void
protected filterArray(array $data, array $rules) : array
protected validateArray(array $data, array $rules) : void

This class extends \RocketTheme\Toolbox\Blueprints\BlueprintSchema

This class implements \RocketTheme\Toolbox\ArrayTraits\ExportInterface


Class: \Grav\Common\Data\Data

Visibility Function
public __construct(array $items=array(), \Grav\Common\Data\Blueprint/callable $blueprints=null) : void
public __get(mixed $offset) : mixed Asset value
Magic getter method
public __isset(mixed $offset) : boolean True if the value is set
Magic method to determine if the attribute is set
public __set(mixed $offset, mixed $value) : void
Magic setter method
public __unset(mixed $offset) : void
Magic method to unset the attribute
public blueprints() : \Grav\Common\Data\Blueprint
Return blueprints.
public count() : int
Implements Countable interface.
public def(string $name, mixed $default=null, string $separator=null) : \Grav\Common\Data\$this
Set default value by using dot notation for nested arrays/objects.
public exists() : bool
Returns whether the data already exists in the storage. NOTE: This method does not check if the data is current.
public extra() : array
Get extra items which haven't been defined in blueprints.
public file(\RocketTheme\Toolbox\File\FileInterface $storage=null) : \RocketTheme\Toolbox\File\FileInterface
Set or get the data storage.
public filter() : $this Filter all items by using blueprints.
public get(string $name, mixed $default=null, string $separator=null) : mixed Value.
Get value by using dot notation for nested arrays/objects.
public getDefaults() : array
Get nested structure containing default values defined in the blueprints. Fields without default value are ignored in the list.
public getJoined(string $name, array $value, string $separator='.') : array
Get value from the configuration and join it with given data.
public join(string $name, mixed $value, string $separator='.') : \Grav\Common\Data\$this
Join nested values together by using blueprints.
public joinDefaults(string $name, mixed $value, string $separator='.') : \Grav\Common\Data\$this
Set default values by using blueprints.
public merge(array $data) : \Grav\Common\Data\$this
Merge two configurations together.
public offsetExists(mixed $offset) : bool Returns TRUE on success or FALSE on failure.
Whether or not an offset exists.
public offsetGet(mixed $offset) : mixed Can return all value types.
Returns the value at specified offset.
public offsetSet(mixed $offset, mixed $value) : void
Assigns a value to the specified offset.
public offsetUnset(mixed $offset) : void
Unsets variable at specified offset.
public raw() : string
Return unmodified data as raw string. NOTE: This function only returns data which has been saved to the storage.
public save() : void
Save data if storage has been defined.
public set(string $name, mixed $value, string $separator=null) : \Grav\Common\Data\$this
Set value by using dot notation for nested arrays/objects.
public setDefaults(array $data) : \Grav\Common\Data\$this
Set default values to the configuration if variables were not set.
public toArray() : array
Convert object into an array.
public toJson() : string
Convert object into JSON string.
public toYaml(int $inline=3, int $indent=2) : string A YAML string representing the object.
Convert object into YAML string.
public undef(string $name, string $separator=null) : \Grav\Common\Data\$this
Unset value by using dot notation for nested arrays/objects.
public validate() : \Grav\Common\Data\$this
Validate by blueprints.
public value(string $name, mixed $default=null, string $separator='.') : mixed Value.
Get value by using dot notation for nested arrays/objects.
Examples of Data::def()
$data->def('this.is.my.nested.variable', 'default');
Examples of Data::get()
$value = $this->get('this.is.my.nested.variable');
Examples of Data::set()
$data->set('this.is.my.nested.variable', $value);
Examples of Data::undef()
$data->undef('this.is.my.nested.variable');
Examples of Data::value()
$value = $data->value('this.is.my.nested.variable');

This class implements \Grav\Common\Data\DataInterface, \ArrayAccess, \Countable, \RocketTheme\Toolbox\ArrayTraits\ExportInterface


Interface: \Grav\Common\Data\DataInterface

Visibility Function
public blueprints() : void
Return blueprints.
public extra() : void
Get extra items which haven't been defined in blueprints.
public file(\RocketTheme\Toolbox\File\FileInterface $storage=null) : \RocketTheme\Toolbox\File\FileInterface
Set or get the data storage.
public filter() : void
Filter all items by using blueprints.
public merge(array $data) : mixed
Merge external data.
public save() : void
Save data into the file.
public validate() : void
Validate by blueprints.
public value(string $name, mixed $default=null, string $separator='.') : mixed Value.
Get value by using dot notation for nested arrays/objects.
Examples of DataInterface::value()
$value = $data->value('this.is.my.nested.variable');


Class: \Grav\Common\Data\Validation

Visibility Function
public static filter(mixed $value, array $field) : mixed Filtered value.
Filter value against a blueprint field definition.
public static filterIgnore(mixed $value, array $params, array $field) : void
public static filterYaml(mixed $value, mixed $params) : void
public static typeArray(mixed $value, array $params, array $field) : bool True if validation succeeded.
Custom input: array
public static typeBool(mixed $value, mixed $params) : void
public static typeCheckbox(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: checkbox
public static typeCheckboxes(mixed $value, array $params, array $field) : bool True if validation succeeded.
Custom input: checkbox list
public static typeColor(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: color
public static typeDate(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: date
public static typeDatetime(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: datetime
public static typeDatetimeLocal(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: datetime-local
public static typeEmail(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: email
public static typeFile(mixed $value, array $params, array $field) : bool True if validation succeeded.
Custom input: file
public static typeHidden(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: hidden
public static typeIgnore(mixed $value, array $params, array $field) : bool True if validation succeeded.
Custom input: ignore (will not validate)
public static typeList(mixed $value, array $params, array $field) : void
public static typeMonth(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: month
public static typeNumber(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: number
public static typePassword(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: password
public static typeRadio(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: radio
public static typeRange(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: range
public static typeSelect(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: select
public static typeText(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: text
public static typeTextarea(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: textarea
public static typeTime(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: time
public static typeToggle(mixed $value, array $params, array $field) : bool True if validation succeeded.
Custom input: toggle
public static typeUrl(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: url
public static typeWeek(mixed $value, array $params, array $field) : bool True if validation succeeded.
HTML5 input: week
public static typeYaml(mixed $value, mixed $params) : void
public static validate(mixed $value, array $field) : array
Validate value against a blueprint field definition.
public static validateAlnum(mixed $value, mixed $params) : void
public static validateAlpha(mixed $value, mixed $params) : void
public static validateArray(mixed $value, mixed $params) : void
public static validateBool(mixed $value, mixed $params) : void
public static validateDigit(mixed $value, mixed $params) : void
public static validateFloat(mixed $value, mixed $params) : void
public static validateHex(mixed $value, mixed $params) : void
public static validateInt(mixed $value, mixed $params) : void
public static validateJson(mixed $value, mixed $params) : void
public static validatePattern(mixed $value, mixed $params) : void
public static validateRequired(mixed $value, mixed $params) : void
protected static filterArray(mixed $value, mixed $params, mixed $field) : void
protected static filterBool(mixed $value, mixed $params) : void
protected static filterCheckboxes(mixed $value, array $params, array $field) : void
protected static filterCommaList(mixed $value, array $params, array $field) : void
protected static filterDateTime(mixed $value, array $params, array $field) : void
protected static filterFile(mixed $value, array $params, array $field) : void
protected static filterFloat(mixed $value, mixed $params) : void
protected static filterInt(mixed $value, mixed $params) : void
protected static filterList(mixed $value, array $params, array $field) : void
protected static filterLower(mixed $value, array $params) : void
protected static filterNumber(mixed $value, array $params, array $field) : void
protected static filterRange(mixed $value, array $params, array $field) : void
protected static filterText(mixed $value, array $params, array $field) : void
protected static filterUpper(mixed $value, array $params) : void
protected static typeCommaList(mixed $value, array $params, array $field) : void


Class: \Grav\Common\Data\ValidationException

Visibility Function
public getMessages() : mixed
public setMessages(array $messages=array()) : void

This class extends \RuntimeException

This class implements \Throwable


Class: \Grav\Common\Errors\BareHandler

Visibility Function
public handle() : int/null

This class extends \Whoops\Handler\Handler

This class implements \Whoops\Handler\HandlerInterface


Class: \Grav\Common\Errors\Errors

Visibility Function
public resetHandlers() : void


Class: \Grav\Common\Errors\SimplePageHandler

Visibility Function
public __construct() : void
public addResourcePath(mixed $path) : void
public getResourcePaths() : mixed
public handle() : int/null
protected getResource(mixed $resource) : string

This class extends \Whoops\Handler\Handler

This class implements \Whoops\Handler\HandlerInterface


Class: \Grav\Common\Errors\SystemFacade

Visibility Function
public handleShutdown() : void
Special case to deal with Fatal errors and the like.
public registerShutdownFunction(\callable $function) : void

This class extends \Whoops\Util\SystemFacade


Class: \Grav\Common\File\CompiledJsonFile

Visibility Function
public content(mixed $var=null) : string
Get/set parsed file contents.
protected decode(string $var, bool $assoc=true) : array mixed
Decode RAW string into contents.

This class extends \RocketTheme\Toolbox\File\JsonFile

This class implements \RocketTheme\Toolbox\File\FileInterface


Class: \Grav\Common\File\CompiledMarkdownFile

Visibility Function
public content(mixed $var=null) : string
Get/set parsed file contents.

This class extends \RocketTheme\Toolbox\File\MarkdownFile

This class implements \RocketTheme\Toolbox\File\FileInterface


Class: \Grav\Common\File\CompiledYamlFile

Visibility Function
public content(mixed $var=null) : string
Get/set parsed file contents.

This class extends \RocketTheme\Toolbox\File\YamlFile

This class implements \RocketTheme\Toolbox\File\FileInterface


Class: \Grav\Common\Filesystem\Folder (abstract)

Visibility Function
public static all(string $path, array $params=array()) : array
Return recursive list of all files and directories under given path.
public static copy(string $source, string $target, string $ignore=null) : void
Recursively copy directory in filesystem.
public static create(string $folder) : mixed
public static delete(string $target, bool $include_target=true) : bool
Recursively delete directory from filesystem.
public static getRelativePath(string $path, string/mixed/string $base='/Users/rhuk/workspace/grav-demo-sampler') : string
Get relative path between target and base path. If path isn't relative, return full path.
public static getRelativePathDotDot(string $path, string $base) : string
Get relative path between target and base path. If path isn't relative, return full path.
public static hashAllFiles(mixed $path) : string
Recursively md5 hash all files in a path
public static lastModifiedFile(string $path, string $extensions='md|yaml') : int
Recursively find the last modified time under given path by file.
public static lastModifiedFolder(string $path) : int
Recursively find the last modified time under given path.
public static mkdir(string $folder) : void
public static move(string $source, string $target) : void
Move directory in filesystem.
public static rcopy(mixed $src, mixed $dest) : bool
Recursive copy of one directory to another
public static shift(string $path) : string
Shift first directory out of the path.
protected static doDelete(string $folder, bool $include_target=true) : bool


Class: \Grav\Common\Filesystem\RecursiveFolderFilterIterator

Visibility Function
public __construct(\RecursiveIterator $iterator) : void
Create a RecursiveFilterIterator from a RecursiveIterator
public accept() : bool true if the current element is acceptable, otherwise false.
Check whether the current element of the iterator is acceptable

This class extends \RecursiveFilterIterator

This class implements \RecursiveIterator, \OuterIterator, \Traversable, \Iterator


Class: \Grav\Common\GPM\AbstractCollection (abstract)

Visibility Function
public toArray() : void
public toJson() : void

This class extends \Grav\Common\Iterator

This class implements \Serializable, \Countable, \Traversable, \Iterator, \ArrayAccess


Class: \Grav\Common\GPM\GPM

Visibility Function
public __construct(bool/boolean $refresh=false, callable $callback=null) : void
Creates a new GPM instance with Local and Remote packages available
public calculateMergedDependenciesOfPackages(array $packages) : mixed
Calculates and merges the dependencies of the passed packages
public calculateVersionNumberFromDependencyVersion(string $version) : null/string
Returns the actual version from a dependency version string. Examples: $versionInformation == '~2.0' => returns '2.0' $versionInformation == '>=2.0.2' => returns '2.0.2' $versionInformation == '2.0.2' => returns '2.0.2' $versionInformation == '*' => returns null $versionInformation == '' => returns null
public checkNextSignificantReleasesAreCompatible(string $version1, string $version2) : bool
Check if two releases are compatible by next significant release ~1.2 is equivalent to >=1.2 <2.0.0 ~1.2.3 is equivalent to >=1.2.3 <1.3.0 In short, allows the last digit specified to go up
public checkNoOtherPackageNeedsTheseDependenciesInALowerVersion(mixed $dependencies_slugs) : void
public checkNoOtherPackageNeedsThisDependencyInALowerVersion(string $slug, string $version_with_operator, array $ignore_packages_list) : bool
Check the package identified by $slug can be updated to the version passed as argument. Thrown an exception if it cannot be updated because another package installed requires it to be at an older version.
public checkPackagesCanBeInstalled(mixed $packages_names_list) : void
Check the passed packages list can be updated
public static copyPackage(mixed $package_file, mixed $tmp) : null/string
Copy the local zip package to tmp
public countInstalled() : integer Amount of installed packages
Returns the amount of locally installed packages
public countUpdates() : integer Amount of available updates
Returns the amount of updates available
public static downloadPackage(mixed $package_file, mixed $tmp) : null/string
Download the zip package via the URL
public findPackage(string $search, bool $ignore_exception=false) : \Grav\Common\GPM\Remote\Package/bool Package if found, FALSE if not
Searches for a Package in the repository
public findPackages(array $searches=array()) : array Array of found Packages Format: ['total' => int, 'not_found' => array, ]
Searches for a list of Packages in the repository
public static getBlueprints(mixed $source) : array/bool
Find/Parse the blueprint file
public getDependencies(array $packages) : mixed
Fetch the dependencies, check the installed packages and return an array with the list of packages with associated an information on what to do: install, update or ignore. ignore means the package is already installed and can be safely left as-is. install means the package is not installed and must be installed. update means the package is already installed and must be updated as a dependency needs a higher version.
public static getInstallPath(mixed $type, mixed $name) : string
Get the install path for a name and a particular type of package
public getInstallable(array $list_type_installed=array()) : array The installed packages
Returns the Locally installable packages
public getInstalled() : \Grav\Common\GPM\Local\Packages
Return the locally installed packages
public getInstalledPackage(string $slug) : Local\Package The instance of the Package
Return the instance of a specific Package
public getInstalledPlugin(string $slug) : Local\Package The instance of the Plugin
Return the instance of a specific Plugin
public getInstalledPlugins() : Iterator The installed plugins
Returns the Locally installed plugins
public getInstalledTheme(string $slug) : Local\Package The instance of the Theme
Return the instance of a specific Theme
public getInstalledThemes() : Iterator The installed themes
Returns the Locally installed themes
public getLatestVersionOfPackage(mixed $package_name) : string/null
Get the latest release of a package from the GPM
public static getPackageName(mixed $source) : bool/string
Try to guess the package name from the source files
public static getPackageType(mixed $source) : bool/string
Try to guess the package type from the source files
public getPackagesThatDependOnPackage(string $slug) : array
Return the list of packages that have the passed one as dependency
public getReleaseType(mixed $package_name) : string/null
Get the release type of a package (stable / testing)
public getRepository() : Remote\Packages Available Plugins and Themes Format: ['plugins' => array, 'themes' => array]
Returns the list of Plugins and Themes available in the repository
public getRepositoryPlugin(string $slug) : mixed Package if found, NULL if not
Returns a Plugin from the repository
public getRepositoryPlugins() : Iterator The Plugins remotely available
Returns the list of Plugins available in the repository
public getRepositoryTheme(string $slug) : mixed Package if found, NULL if not
Returns a Theme from the repository
public getRepositoryThemes() : Iterator The Themes remotely available
Returns the list of Themes available in the repository
public getUpdatable(array $list_type_update=array()) : array Array of updatable Plugins and Themes. Format: ['total' => int, 'plugins' => array, 'themes' => array]
Returns an array of Plugins and Themes that can be updated. Plugins and Themes are extended with the available property that relies to the remote version
public getUpdatablePlugins() : array Array of updatable Plugins
Returns an array of Plugins that can be updated. The Plugins are extended with the available property that relies to the remote version
public getUpdatableThemes() : array Array of updatable Themes
Returns an array of Themes that can be updated. The Themes are extended with the available property that relies to the remote version
public getVersionOfDependencyRequiredByPackage(mixed $package_slug, mixed $dependency_slug) : mixed
Get the required version of a dependency of a package
public isPluginInstalled(string $slug) : boolean True if the Plugin has been installed. False otherwise
Checks if a Plugin is installed
public isPluginInstalledAsSymlink(mixed $slug) : bool
public isPluginUpdatable(string $plugin) : boolean True if the Plugin is updatable. False otherwise
Checks if a Plugin is updatable
public isStableRelease(mixed $package_name) : boolean
Returns true if the package latest release is stable
public isTestingRelease(mixed $package_name) : boolean
Returns true if the package latest release is testing
public isThemeInstalled(string $slug) : boolean True if the Theme has been installed. False otherwise
Checks if a Theme is installed
public isThemeUpdatable(string $theme) : boolean True if the Theme is updatable. False otherwise
Checks if a Theme is Updatable
public isUpdatable(string $slug) : boolean True if updatable. False otherwise or if not found
Check if a Plugin or Theme is updatable
public versionFormatIsEqualOrHigher(mixed $version) : bool
Check if the passed version information contains equal or higher operator Example: returns true for $version: '>=2.0'
public versionFormatIsNextSignificantRelease(mixed $version) : bool
Check if the passed version information contains next significant release (tilde) operator Example: returns true for $version: '~2.0'

This class extends \Grav\Common\Iterator

This class implements \Serializable, \Countable, \Traversable, \Iterator, \ArrayAccess


Class: \Grav\Common\GPM\Installer

Visibility Function
public static copyInstall(mixed $source_path, mixed $install_path) : bool
public static getMessage() : string The message
Returns the last message added by the installer
public static install(string $zip, string $destination, array $options=array(), string $extracted=null) : bool True if everything went fine, False otherwise.
Installs a given package to a given destination.
public static isGravInstance(string $target) : boolean True if is a Grav Instance. False otherwise
Validates if the given path is a Grav Instance
public static isValidDestination(string $destination, array $exclude=array()) : boolean True if validation passed. False otherwise
Runs a set of checks on the destination and sets the Error if any
public static lastErrorCode() : integer The code of the last error
Returns the last error code of the occurred error
public static lastErrorMsg() : string The message of the last error
Returns the last error occurred in a string message format
public static moveInstall(mixed $source_path, mixed $install_path) : bool
public static setError(int/string $error) : void
Allows to manually set an error
public static sophisticatedInstall(mixed $source_path, mixed $install_path, array $ignores=array()) : bool
public static unZip(mixed $zip_file, mixed $destination) : bool/string
Unzip a file to somewhere
public static uninstall(string $path, array $options=array()) : boolean True if everything went fine, False otherwise.
Uninstalls one or more given package


Class: \Grav\Common\GPM\Licenses

Class Licenses

Visibility Function
public static get(mixed $slug=null) : string
Returns the license for a Premium package
public static getLicenseFile() : \RocketTheme\Toolbox\File\FileInterface
Get's the License File object
public static set(mixed $slug, mixed $license) : boolean
Returns the license for a Premium package
public static validate(mixed $license=null) : bool
Validates the License format


Class: \Grav\Common\GPM\Response

Visibility Function
public static get(string $uri='', array $options=array(), callable $callback=null) : string The response of the request
Makes a request to the URL by using the preferred method
public static isCurlAvailable() : boolean
Checks if cURL is available
public static isFopenAvailable() : boolean
Checks if the remote fopen request is enabled in PHP
public static isRemote(mixed $file) : bool
Is this a remote file or not
public static progress() : void
Progress normalized for cURL and Fopen Accepts a variable length of arguments passed in by stream method
public static setMethod(string $method='auto') : \Grav\Common\GPM\Response
Sets the preferred method to use for making HTTP calls.


Class: \Grav\Common\GPM\Upgrader

Class Upgrader

Visibility Function
public __construct(bool/boolean $refresh=false, callable $callback=null) : void
Creates a new GPM instance with Local and Remote packages available
public getAssets() : array
Returns an array of assets available to download remotely
public getChangelog(string $diff=null) : array return the changelog list for each version
Returns the changelog list for each version of Grav
public getLocalVersion() : string
Returns the version of the installed Grav
public getReleaseDate() : string
Returns the release date of the latest version of Grav
public getRemoteVersion() : string
Returns the version of the remotely available Grav
public isSymlink() : boolean True if Grav is symlinked, False otherwise.
Checks if Grav is currently symbolically linked
public isUpgradable() : boolean True if it's upgradable, False otherwise.
Checks if the currently installed Grav is upgradable to a newer version
public meetsRequirements() : bool


Class: \Grav\Common\GPM\Common\AbstractPackageCollection (abstract)

Visibility Function
public toArray() : void
public toJson() : void

This class extends \Grav\Common\Iterator

This class implements \Serializable, \Countable, \Traversable, \Iterator, \ArrayAccess


Class: \Grav\Common\GPM\Common\CachedCollection

Visibility Function
public __construct(mixed $items) : void

This class extends \Grav\Common\Iterator

This class implements \Serializable, \Countable, \Traversable, \Iterator, \ArrayAccess


Class: \Grav\Common\GPM\Common\Package

Visibility Function
public __construct(\Grav\Common\Data\Data $package, mixed $type=null) : void
public __get(mixed $key) : void
public __isset(mixed $key) : void
public __toString() : void
public getData() : mixed
public toArray() : void
public toJson() : void


Class: \Grav\Common\GPM\Local\AbstractPackageCollection (abstract)

Visibility Function
public __construct(mixed $items) : void

This class extends \Grav\Common\GPM\Common\AbstractPackageCollection

This class implements \ArrayAccess, \Iterator, \Traversable, \Countable, \Serializable


Class: \Grav\Common\GPM\Local\Package

Visibility Function
public __construct(\Grav\Common\Data\Data $package, mixed $package_type=null) : void
public isEnabled() : mixed

This class extends \Grav\Common\GPM\Common\Package


Class: \Grav\Common\GPM\Local\Packages

Visibility Function
public __construct() : void

This class extends \Grav\Common\GPM\Common\CachedCollection

This class implements \ArrayAccess, \Iterator, \Traversable, \Countable, \Serializable


Class: \Grav\Common\GPM\Local\Plugins

Visibility Function
public __construct() : void
Local Plugins Constructor

This class extends \Grav\Common\GPM\Local\AbstractPackageCollection

This class implements \Serializable, \Countable, \Traversable, \Iterator, \ArrayAccess


Class: \Grav\Common\GPM\Local\Themes

Visibility Function
public __construct() : void
Local Themes Constructor

This class extends \Grav\Common\GPM\Local\AbstractPackageCollection

This class implements \Serializable, \Countable, \Traversable, \Iterator, \ArrayAccess


Class: \Grav\Common\GPM\Remote\AbstractPackageCollection

Visibility Function
public __construct(null $repository=null, bool $refresh=false, null $callback=null) : void
AbstractPackageCollection constructor.
public fetch(bool $refresh=false, mixed $callback=null) : mixed

This class extends \Grav\Common\GPM\Common\AbstractPackageCollection

This class implements \ArrayAccess, \Iterator, \Traversable, \Countable, \Serializable


Class: \Grav\Common\GPM\Remote\GravCore

Visibility Function
public __construct(bool $refresh=false, null $callback=null) : void
public getAssets() : array list of assets
Returns the list of assets associated to the latest version of Grav
public getChangelog(string $diff=null) : array changelog list for each version
Returns the changelog list for each version of Grav
public getDate() : string
Return the release date of the latest Grav
public getVersion() : string
Returns the latest version of Grav available remotely
public isSymlink() : bool
public isUpdatable() : bool

This class extends \Grav\Common\GPM\Remote\AbstractPackageCollection

This class implements \Serializable, \Countable, \Traversable, \Iterator, \ArrayAccess


Class: \Grav\Common\GPM\Remote\Package

Visibility Function
public __construct(mixed $package, mixed $package_type=null) : void

This class extends \Grav\Common\GPM\Common\Package


Class: \Grav\Common\GPM\Remote\Packages

Visibility Function
public __construct(bool $refresh=false, mixed $callback=null) : void

This class extends \Grav\Common\GPM\Common\CachedCollection

This class implements \ArrayAccess, \Iterator, \Traversable, \Countable, \Serializable


Class: \Grav\Common\GPM\Remote\Plugins

Visibility Function
public __construct(bool $refresh=false, callable $callback=null) : void
Local Plugins Constructor

This class extends \Grav\Common\GPM\Remote\AbstractPackageCollection

This class implements \Serializable, \Countable, \Traversable, \Iterator, \ArrayAccess


Class: \Grav\Common\GPM\Remote\Themes

Visibility Function
public __construct(bool $refresh=false, callable $callback=null) : void
Local Themes Constructor

This class extends \Grav\Common\GPM\Remote\AbstractPackageCollection

This class implements \Serializable, \Countable, \Traversable, \Iterator, \ArrayAccess


Class: \Grav\Common\Helpers\Base32

Visibility Function
public static decode(mixed $base32) : string
Decode in Base32
public static encode(mixed $bytes) : string
Encode in Base32


Class: \Grav\Common\Helpers\Excerpts

Visibility Function
public static getExcerptFromHtml(string $html, string $tag) : array/null returns nested array excerpt
Get an Excerpt array from a chunk of HTML
public static getHtmlFromExcerpt(mixed $excerpt) : string
Rebuild HTML tag from an excerpt array
public static processImageExcerpt(array $excerpt, \Grav\Common\Page\Page $page) : mixed
Process an image excerpt
public static processImageHtml(string $html, \Grav\Common\Page\Page $page) : string Returns final HTML string
Process Grav image media URL from HTML tag
public static processLinkExcerpt(mixed $excerpt, \Grav\Common\Page\Page $page, string $type='link') : mixed
Process a Link excerpt
public static processMediaActions(mixed $medium, mixed $url) : mixed
Process media actions
protected static parseUrl(string $url) : array/bool
Variation of parse_url() which works also with local streams.
protected static resolveStream(mixed $url) : void


Class: \Grav\Common\Helpers\Exif

Visibility Function
public __construct() : void
public getReader() : mixed


Class: \Grav\Common\Helpers\Truncator

This file is part of https://github.com/Bluetel-Solutions/twig-truncate-extension Copyright (c) 2015 Bluetel Solutions developers@bluetel.co.uk Copyright (c) 2015 Alex Wilson ajw@bluetel.co.uk For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

Visibility Function
public static htmlToDomDocument(string $html) : void
Builds a DOMDocument object from a string containing HTML.
public static truncateLetters(string $html, integer $limit, string $ellipsis='') : string Safe truncated HTML.
Safely truncates HTML by a given number of letters.
public static truncateWords(string $html, integer $limit, string $ellipsis='') : string Safe truncated HTML.
Safely truncates HTML by a given number of words.


Class: \Grav\Common\Language\Language

Visibility Function
public __construct(\Grav\Common\Grav $grav) : void
Constructor
public enabled() : bool
Ensure that languages are enabled
public getActive() : mixed
Gets current active language
public getAvailable() : string
Gets a pipe-separated string of available languages
public getBrowserLanguages(array $accept_langs=array()) : array
Get the browser accepted languages
public getDefault() : mixed
Gets current default language
public getFallbackLanguages() : array
Gets an array of languages with active first, then fallback languages
public getFallbackPageExtensions(string/null $file_ext=null) : array
Gets an array of valid extensions with active first, then fallback extensions
public getLanguage() : mixed
Gets language, active if set, else default
public getLanguageURLPrefix(null $lang=null) : string
Get's a URL prefix based on configuration
public getLanguages() : array
Gets the array of supported languages
public getTranslation(string $lang, string $key, bool $array_support=false) : string
Lookup the translation text for a given lang and key
public init() : void
Initialize the default and enabled languages
public isIncludeDefaultLanguage(null $lang=null) : bool
Test to see if language is default and language should be included in the URL
public isLanguageInUrl() : bool
Simple getter to tell if a language was found in the URL
public resetFallbackPageExtensions() : void
Resets the page_extensions value. Useful to re-initialize the pages and change site language at runtime, example: $this->grav['language']->setActive('it'); $this->grav['language']->resetFallbackPageExtensions(); $this->grav['pages']->init();
public setActive(mixed $lang) : bool
Sets active language manually
public setActiveFromUri(mixed $uri) : mixed
Sets the active language based on the first part of the URL
public setDefault(mixed $lang) : bool
Sets default language manually
public setLanguages(mixed $langs) : void
Sets the current supported languages manually
public translate(mixed $args, array $languages=null, bool $array_support=false, bool $html_out=false) : string
Translate a key and possibly arguments into a string using current lang and fallbacks Other arguments can be passed and replaced in the translation with sprintf syntax
public translateArray(mixed $key, mixed $index, null $languages=null, bool $html_out=false) : string
Translate Array
public validate(mixed $lang) : bool
Ensures the language is valid and supported


Class: \Grav\Common\Language\LanguageCodes

Visibility Function
public static getName(mixed $code) : mixed
public static getNames(array $keys) : mixed
public static getNativeName(mixed $code) : mixed
public static getOrientation(mixed $code) : mixed
public static isRtl(mixed $code) : bool
protected static get(mixed $code, mixed $type) : mixed


Class: \Grav\Common\Markdown\Parsedown

Visibility Function
public __call(mixed $method, mixed $args) : void
public __construct(mixed $page, mixed $defaults) : void
Parsedown constructor.
public addBlockType(mixed $type, mixed $tag, bool $continuable=false, bool $completable=false, mixed $index=null) : void
Be able to define a new Block type or override an existing one
public addInlineType(mixed $type, mixed $tag, mixed $index=null) : void
Be able to define a new Inline type or override an existing one
public elementToHtml(array $Element) : string markup
Make the element function publicly accessible, Medium uses this to render from Twig
public setSpecialChars(mixed $special_chars) : \Grav\Common\Markdown\$this
Setter for special chars
protected blockTwigTag(mixed $Line) : void
Ensure Twig tags are treated as block level items with no

tags
protected init(mixed $page, mixed $defaults) : void
Initialization function to setup key variables needed by the MarkdownGravLinkTrait
protected inlineImage(mixed $excerpt) : void
protected inlineLink(mixed $excerpt) : void
protected inlineSpecialCharacter(mixed $Excerpt) : void
protected isBlockCompletable(mixed $Type) : bool
Overrides the default behavior to allow for plugin-provided blocks to be completable
protected isBlockContinuable(mixed $Type) : bool
Overrides the default behavior to allow for plugin-provided blocks to be continuable

This class extends \Parsedown


Class: \Grav\Common\Markdown\ParsedownExtra

Visibility Function
public __call(mixed $method, mixed $args) : void
public __construct(mixed $page, mixed $defaults) : void
ParsedownExtra constructor.
public addBlockType(mixed $type, mixed $tag, bool $continuable=false, bool $completable=false, mixed $index=null) : void
Be able to define a new Block type or override an existing one
public addInlineType(mixed $type, mixed $tag, mixed $index=null) : void
Be able to define a new Inline type or override an existing one
public elementToHtml(array $Element) : string markup
Make the element function publicly accessible, Medium uses this to render from Twig
public setSpecialChars(mixed $special_chars) : \Grav\Common\Markdown\$this
Setter for special chars
protected blockTwigTag(mixed $Line) : void
Ensure Twig tags are treated as block level items with no

tags
protected init(mixed $page, mixed $defaults) : void
Initialization function to setup key variables needed by the MarkdownGravLinkTrait
protected inlineImage(mixed $excerpt) : void
protected inlineLink(mixed $excerpt) : void
protected inlineSpecialCharacter(mixed $Excerpt) : void
protected isBlockCompletable(mixed $Type) : bool
Overrides the default behavior to allow for plugin-provided blocks to be completable
protected isBlockContinuable(mixed $Type) : bool
Overrides the default behavior to allow for plugin-provided blocks to be continuable

This class extends \ParsedownExtra


Class: \Grav\Common\Page\Collection

Visibility Function
public __construct(array $items=array(), array $params=array(), \Grav\Common\Page\Pages/null/\Grav\Common\Page\Pages $pages=null) : void
Collection constructor.
public add(mixed $path, mixed $slug) : \Grav\Common\Page\$this
Add a page with path and slug
public addPage(\Grav\Common\Page\Page $page) : \Grav\Common\Page\$this
Add a single page to a collection
public adjacentSibling(string $path, integer $direction=1) : Page The sibling item.
Returns the adjacent sibling based on a direction.
public batch(mixed $size) : array/\Grav\Common\Page\Collection[]
Split collection into array of smaller collections.
public copy() : \Grav\Common\Page\static
Create a copy of this collection
public current() : \Grav\Common\Page\Page
Returns current page.
public currentPosition(string $path) : Integer the index of the current page.
Returns the item in the current position.
public dateRange(mixed $startDate, bool $endDate=false, bool/mixed $field=false) : \Grav\Common\Page\$this
Returns the items between a set of date ranges of either the page date field (default) or an arbitrary datetime page field where end date is optional Dates can be passed in as text that strtotime() can process http://php.net/manual/en/function.strtotime.php
public intersect(\Grav\Common\Page\Collection $collection) : \Grav\Common\Page\$this
Intersect another collection with the current collection
public isFirst(string $path) : boolean True if item is first.
Check to see if this item is the first in the collection.
public isLast(string $path) : boolean True if item is last.
Check to see if this item is the last in the collection.
public key() : mixed
Returns current slug.
public merge(\Grav\Common\Page\Collection $collection) : \Grav\Common\Page\$this
Merge another collection with the current collection
public modular() : Collection The collection with only modular pages
Creates new collection with only modular pages
public nextSibling(string $path) : Page The next item.
Gets the next sibling based on current position.
public nonModular() : Collection The collection with only non-modular pages
Creates new collection with only non-modular pages
public nonPublished() : Collection The collection with only non-published pages
Creates new collection with only non-published pages
public nonRoutable() : Collection The collection with only non-routable pages
Creates new collection with only non-routable pages
public nonVisible() : Collection The collection with only non-visible pages
Creates new collection with only non-visible pages
public ofOneOfTheseAccessLevels(mixed $accessLevels) : Collection The collection
Creates new collection with only pages of one of the specified access levels
public ofOneOfTheseTypes(mixed $types) : Collection The collection
Creates new collection with only pages of one of the specified types
public ofType(mixed $type) : Collection The collection
Creates new collection with only pages of the specified type
public offsetGet(mixed $offset) : mixed Can return all value types.
Returns the value at specified offset.
public order(string $by, string $dir='asc', array $manual=null, string $sort_flags=null) : \Grav\Common\Page\$this
Reorder collection.
public params() : array
Get the collection params
public prevSibling(string $path) : Page The previous item.
Gets the previous sibling based on current position.
public published() : Collection The collection with only published pages
Creates new collection with only published pages
public remove(\Grav\Common\Page\Page/string/null $key=null) : \Grav\Common\Page\$this
Remove item from the list.
public routable() : Collection The collection with only routable pages
Creates new collection with only routable pages
public setParams(array $params) : \Grav\Common\Page\$this
Set parameters to the Collection
public visible() : Collection The collection with only visible pages
Creates new collection with only visible pages

This class extends \Grav\Common\Iterator

This class implements \Serializable, \Countable, \Traversable, \Iterator, \ArrayAccess


Class: \Grav\Common\Page\Header

Visibility Function
public __construct(array $items=array()) : void
Constructor to initialize array.
public def(string $name, mixed $default=null, string $separator=null) : \Grav\Common\Page\$this
Set default value by using dot notation for nested arrays/objects.
public get(string $name, mixed $default=null, string $separator=null) : mixed Value.
Get value by using dot notation for nested arrays/objects.
public offsetExists(mixed $offset) : bool Returns TRUE on success or FALSE on failure.
Whether or not an offset exists.
public offsetGet(mixed $offset) : mixed Can return all value types.
Returns the value at specified offset.
public offsetSet(mixed $offset, mixed $value) : void
Assigns a value to the specified offset.
public offsetUnset(mixed $offset) : void
Unsets variable at specified offset.
public set(string $name, mixed $value, string $separator=null) : \Grav\Common\Page\$this
Set value by using dot notation for nested arrays/objects.
public undef(string $name, string $separator=null) : \Grav\Common\Page\$this
Unset value by using dot notation for nested arrays/objects.
Examples of Header::def()
$data->def('this.is.my.nested.variable', 'default');
Examples of Header::get()
$value = $this->get('this.is.my.nested.variable');
Examples of Header::set()
$data->set('this.is.my.nested.variable', $value);
Examples of Header::undef()
$data->undef('this.is.my.nested.variable');

This class implements \ArrayAccess


Class: \Grav\Common\Page\Media

Visibility Function
public __construct(mixed $path) : void
public __wakeup() : void
Initialize static variables on unserialize.
public offsetExists(mixed $offset) : bool
public offsetGet(mixed $offset) : mixed
public path() : mixed
Enable accessing the media path
protected init() : void
Initialize class.

This class extends \Grav\Common\Page\Medium\AbstractMedia

This class implements \ArrayAccess, \Countable


Class: \Grav\Common\Page\Page

Visibility Function
public __construct() : void
Page Object Constructor
public active() : bool True if it is active
Returns whether or not this page is the currently active page requested via the URL.
public activeChild() : bool True if active child exists
Returns whether or not this URI's URL contains the URL of the active page. Or in other words, is this page's URL in the current URL
public addContentMeta(mixed $name, mixed $value) : void
Add an entry to the page's contentMeta array
public adjacentSibling(integer $direction=1) : \Grav\Common\Page\Page/bool the sibling page
Returns the adjacent sibling based on a direction.
public ancestor(bool $lookup=null) : \Grav\Common\Page\Page page you were looking for if it exists
Helper method to return an ancestor page.
public blueprintName() : string
Get the blueprint name for this page. Use the blueprint form field if set
public blueprints() : \Grav\Common\Data\Blueprint
Get blueprints for the page.
public cacheControl(null $var=null) : null
Gets and sets the cache-control property. If not set it will return the default value (null) https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control for more details on valid options
public cachePageContent() : void
Fires the onPageContentProcessed event, and caches the page content using a unique ID for the page
public canonical(bool $include_lang=true) : string
Returns the canonical URL for a page
public childType() : string
Returns child page type.
public children() : \Grav\Common\Page\Collection
Returns children of this page.
public collection(string/string/array $params='content', bool/boolean $pagination=true) : \Grav\Common\Page\Collection
Get a collection of pages in the current context.
public content(string $var=null) : string Content
Gets and Sets the content based on content portion of the .md file
public contentMeta() : mixed
Get the contentMeta array and initialize content first if it's not already
public copy(\Grav\Common\Page\Page $parent) : \Grav\Common\Page\$this
Prepare a copy from the page. Copies also everything that's under the current page. Returns a new Page object for the copy. You need to call $this->save() in order to perform the move.
public currentPosition() : Integer the index of the current page.
Returns the item in the current position.
public date(string $var=null) : int unix timestamp representation of the date
Gets and sets the date for this Page object. This is typically passed in via the page headers
public dateformat(string $var=null) : string string representation of a date format
Gets and sets the date format for this Page object. This is typically passed in via the page headers using typical PHP date string structure - http://php.net/manual/en/function.date.php
public debugger() : mixed
Returns the state of the debugger override etting for this page
public eTag(boolean $var=null) : boolean show etag header
Gets and sets the option to show the etag header for the page.
public evaluate(string $value) : mixed
public exists() : bool
Returns whether the page exists in the filesystem.
public expires(int $var=null) : int The expires value
Gets and sets the expires field. If not set will return the default
public extension(null $var=null) : null/string
Gets and sets the extension field.
public extra() : array
Get unknown header variables.
public file() : \Grav\Common\Page\MarkdownFile/null
Get file object to the page.
public filePath(string $var=null) : string/null the file path
Gets and sets the path to the .md file for this Page object.
public filePathClean() : string The relative file path
Gets the relative path to the .md file
public filter() : void
Filter page header from illegal contents.
public find(string $url, bool $all=false) : \Grav\Common\Page\Page page you were looking for if it exists
Helper method to return a page.
public folder(string $var=null) : string/null
Get/set the folder.
public folderExists() : bool
Returns whether or not the current folder exists
public frontmatter(string/null $var=null) : string
Gets and Sets the page frontmatter
public getContentMeta(null $name=null) : mixed
Return the whole contentMeta array as it currently stands
public getRawContent() : string the current page content
Needed by the onPageContentProcessed event to get the raw page content
public header(object/array $var=null) : object the current YAML configuration
Gets and Sets the header based on the YAML configuration at the top of the .md file
public home() : bool True if it is the homepage
Returns whether or not this page is the currently configured home page.
public id(string $var=null) : string the identifier
Gets and sets the identifier for this Page object.
public inherited(string $field) : \Grav\Common\Page\Page
Helper method to return an ancestor page to inherit from. The current page object is returned.
public inheritedField(string $field) : array
Helper method to return an ancestor field only to inherit from. The first occurrence of an ancestor field will be returned if at all.
public init(\SplFileInfo $file, string $extension=null) : \Grav\Common\Page\$this
Initializes the page instance variables based on a file
public isDir() : bool True if its a directory
Returns whether or not this Page object is a directory or a page.
public isFirst() : boolean True if item is first.
Check to see if this item is the first in an array of sub-pages.
public isLast() : boolean True if item is last
Check to see if this item is the last in an array of sub-pages.
public isPage() : bool True if its a page with a .md file associated
Returns whether or not this Page object has a .md file associated with it or if its just a directory.
public language(mixed $var=null) : mixed
Get page language
public lastModified(boolean $var=null) : boolean show last_modified header
Gets and sets the option to show the last_modified header for the page.
public link(bool $include_host=false) : string the permalink
Gets the URL for a page - alias of url().
public maxCount(int $var=null) : int the maximum number of sub-pages
Gets and sets the maxCount field which describes how many sub-pages should be displayed if the sub_pages header property is set for this page object.
public media(\Grav\Common\Page\Media $var=null) : Media Representation of associated media.
Gets and sets the associated media as found in the page folder.
public menu(string $var=null) : string the menu field for the page
Gets and sets the menu name for this Page. This is the text that can be used specifically for navigation. If no menu field is set, it will use the title()
public metadata(array $var=null) : array an Array of metadata values for the page
Function to merge page metadata tags and build an array of Metadata objects that can then be rendered in the page.
public modified(int $var=null) : int modified unix timestamp
Gets and sets the modified timestamp.
public modifyHeader(mixed $key, mixed $value) : void
Modify a header value directly
public modular(bool $var=null) : bool true if modular_twig
Gets and sets the modular var that helps identify this page is a modular child
public modularTwig(bool $var=null) : bool true if modular_twig
Gets and sets the modular_twig var that helps identify this page as a modular child page that will need twig processing handled differently from a regular page.
public move(\Grav\Common\Page\Page $parent) : \Grav\Common\Page\$this
Prepare move page to new location. Moves also everything that's under the current page. You need to call $this->save() in order to perform the move.
public name(string $var=null) : string The name of this page.
Gets and sets the name field. If no name field is set, it will return 'default.md'.
public nextSibling() : Page the next Page item
Gets the next sibling based on current position.
public order(int $var=null) : int/bool
Get/set order number of this page.
public orderBy(string $var=null) : string supported options include "default", "title", "date", and "folder"
Gets and sets the order by which the sub-pages should be sorted. default - is the order based on the file system, ie 01.Home before 02.Advark title - is the order based on the title set in the pages date - is the order based on the date set in the pages folder - is the order based on the name of the folder with any numerics omitted
public orderDir(string $var=null) : string the order, either "asc" or "desc"
Gets and sets the order by which any sub-pages should be sorted.
public orderManual(string $var=null) : array
Gets the manual order set in the header.
public parent(\Grav\Common\Page\Page $var=null) : \Grav\Common\Page\Page/null the parent page object if it exists.
Gets and Sets the parent object for this page
public path(string $var=null) : string/null the path
Gets and sets the path to the folder where the .md for this Page object resides. This is equivalent to the filePath but without the filename.
public permalink() : string The permalink.
Gets the URL with host information, aka Permalink.
public prevSibling() : Page the previous Page item
Gets the previous sibling based on current position.
public process(array $var=null) : array an Array of name value pairs where the name is the process and value is true or false
Gets and Sets the process setup for this Page. This is multi-dimensional array that consists of a simple array of arrays with the form array("markdown"=>true) for example
public publishDate(string $var=null) : int unix timestamp representation of the date
Gets and Sets the Page publish date
public published(bool $var=null) : bool true if the page is published
Gets and Sets whether or not this Page is considered published
public raw(string $var=null) : string Raw content string
Gets and Sets the raw data
public rawMarkdown(null $var=null) : null
Gets and Sets the Page raw content
public rawRoute(null $var=null) : null/string
Gets and Sets the page raw route
public redirect(string $var=null) : string
Gets the redirect set in the header.
public relativePagePath() : void
Returns the clean path to the page file
public root() : bool True if it is the root
Returns whether or not this page is the root node of the pages tree.
public routable(bool $var=null) : bool true if the page is routable
Gets and Sets whether or not this Page is routable, ie you can reach it via a URL. The page must be routable and published
public route(string $var=null) : string The route for the Page.
Gets the route for the page based on the route headers if available, else from the parents route and the current Page's slug.
public routeAliases(array $var=null) : array The route aliases for the Page.
Gets the route aliases for the page based on page headers.
public routeCanonical(null $var=null) : bool/string
Gets the canonical route for this page if its set. If provided it will use that value, else if it's true it will use the default route.
public save(bool/bool/mixed $reorder=true) : void
Save page if there's a file assigned to it.
public setContentMeta(mixed $content_meta) : mixed
Sets the whole content meta array in one shot
public setRawContent(mixed $content) : void
Needed by the onPageContentProcessed event to set the raw page content
public setSummary(string $summary) : void
Sets the summary of the page
public shouldProcess(string $process) : bool whether or not the processing method is enabled for this Page
Gets the configured state of the processing method.
public slug(string $var=null) : string the slug
Gets and Sets the slug for the Page. The slug is used in the URL routing. If not set it uses the parent folder from the path
public ssl(mixed $var=null) : void
public summary(int $size=null, bool/boolean $textOnly=false) : string
Get the summary.
public taxonomy(array $var=null) : array an array of taxonomies
Gets and sets the taxonomy array which defines which taxonomies this page identifies itself with.
public template(string $var=null) : string the template name
Gets and sets the template field. This is used to find the correct Twig template file to render. If no field is set, it will return the name without the .md extension
public templateFormat(null $var=null) : null
Allows a page to override the output render format, usually the extension provided in the URL. (e.g. html, json, xml, etc).
public title(string $var=null) : string the title of the Page
Gets and sets the title for this Page. If no title is set, it will use the slug() to get a name
public toArray() : array
Convert page to an array.
public toJson() : string
Convert page to JSON encoded string.
public toYaml() : string
Convert page to YAML encoded string.
public topParent() : \Grav\Common\Page\Page/null the top parent page object if it exists.
Gets the top parent object for this page
public translatedLanguages(bool $onlyPublished=false) : array the page translated languages
Return an array with the routes of other translated languages
public unpublishDate(string $var=null) : int/null unix timestamp representation of the date
Gets and Sets the Page unpublish date
public unsetRouteSlug() : void
Helper method to clear the route out so it regenerates next time you use it
public untranslatedLanguages(bool $includeUnpublished=false) : array the page untranslated languages
Return an array listing untranslated languages available
public url(bool $include_host=false, bool $canonical=false, bool $include_lang=true, bool $raw_route=false) : string The url.
Gets the url for the Page.
public urlExtension() : string The extension of this page. For example .html
Returns the page extension, got from the page url_extension config and falls back to the system config system.pages.append_url_extension.
public validate() : void
Validate page header.
public value(string $name, mixed $default=null) : mixed
Get value from a page variable (used mostly for creating edit forms).
public visible(bool $var=null) : bool true if the page is visible
Gets and Sets whether or not this Page is visible for navigation
protected cleanPath(string $path) : string the path
Cleans the path.
protected doRelocation() : void
Moves or copies the page in filesystem.
protected doReorder(mixed $new_order) : void
Reorders all siblings according to a defined order
protected getInheritedParams(string $field) : array
Method that contains shared logic for inherited() and inheritedField()
protected processFrontmatter() : void
protected processMarkdown() : void
Process the Markdown content. Uses Parsedown or Parsedown Extra depending on configuration
protected setPublishState() : void


Class: \Grav\Common\Page\Pages

Visibility Function
public __construct(\Grav\Common\Grav $c) : void
Constructor
public accessLevels() : array
Get access levels of the site pages
public addPage(\Grav\Common\Page\Page $page, string $route=null) : void
Adds a page and assigns a route to it.
public all(\Grav\Common\Page\Page $current=null) : \Grav\Common\Page\Collection
Get all pages
public ancestor(string $route, string $path=null) : \Grav\Common\Page\Page/null
Get a page ancestor.
public base(string $path=null) : string
Get or set base path for the pages.
public baseUrl(string $lang=null, bool $absolute=null) : string
Get base URL for Grav pages.
public blueprints(string $type) : \Grav\Common\Data\Blueprint
Get a blueprint for a page type.
public children(string $path) : \Grav\Common\Page\Collection
Get children of the path.
public dispatch(string $route, bool $all=false, bool $redirect=true) : \Grav\Common\Page\Page/null
Dispatch URI to a page.
public find(string $route, bool $all=false) : \Grav\Common\Page\Page/null
alias method to return find a page.
public get(string $path) : \Grav\Common\Page\Page
Get a page instance.
public static getHomeRoute() : string
Gets the home route
public getList(\Grav\Common\Page\Page $current=null, int $level, bool $rawRoutes=false, bool $showAll=true, bool $showFullpath=false, bool $showSlug=false, bool $showModular=false, bool $limitLevels=false) : array
Get list of route/title of all pages.
public getPagesCacheId() : mixed
Get the Pages cache ID this is particularly useful to know if pages have changed and you want to sync another cache with pages cache - works best in onPagesInitialized()
public static getTypes() : \Grav\Common\Page\Types
Get available page types.
public homeUrl(string $lang=null, bool $absolute=null) : string
Get home URL for Grav site.
public inherited(string $route, string $field=null) : \Grav\Common\Page\Page/null
Get a page ancestor trait.
public init() : void
Class initialization. Must be called before using this class.
public instances() : array/\Grav\Common\Page\Page[]
Returns a list of all pages.
public lastModified(int $modified=null) : int/null
Get or set last modification time.
public static modularTypes() : array
Get available page types.
public static pageTypes() : array
Get template types based on page type (standard or modular)
public static parents() : array
Get available parents routes
public static parentsRawRoutes() : array
Get available parents raw routes.
public static resetHomeRoute() : void
Needed for testing where we change the home route via config
public resetPages(mixed $pages_dir) : void
Accessible method to manually reset the pages cache
public root() : \Grav\Common\Page\Page
Get root page.
public routes() : array
Returns a list of all routes.
public sort(\Grav\Common\Page\Page $page, string $order_by=null, string $order_dir=null, mixed $sort_flags=null) : array
Sort sub-pages in a page.
public sortCollection(\Grav\Common\Page\Collection $collection, mixed $orderBy, string $orderDir='asc', null $orderManual=null, mixed $sort_flags=null) : array
public static types() : array
Get available page types.
public url(string $route='/', string $lang=null, bool $absolute=null) : string
Get home URL for Grav site.
protected arrayShuffle(array $list) : array
Shuffles an associative array
protected buildPages() : void
Builds pages.
protected buildRoutes() : void
protected buildSort(string $path, array $pages, string $order_by='default', array $manual=null, mixed $sort_flags=null) : void
protected recurse(string $directory, \Grav\Common\Page\Page/null $parent=null) : \Grav\Common\Page\Page
Recursive function to load & build page relationships.


Class: \Grav\Common\Page\Types

Visibility Function
public __construct(array $items=array()) : void
Constructor to initialize array.
public count() : int
Implements Countable interface.
public current() : mixed Can return any type.
Returns the current element.
public key() : mixed Returns scalar on success, or NULL on failure.
Returns the key of the current element.
public modularSelect() : void
public next() : void
Moves the current position to the next element.
public offsetExists(mixed $offset) : bool Returns TRUE on success or FALSE on failure.
Whether or not an offset exists.
public offsetGet(mixed $offset) : mixed Can return all value types.
Returns the value at specified offset.
public offsetSet(mixed $offset, mixed $value) : void
Assigns a value to the specified offset.
public offsetUnset(mixed $offset) : void
Unsets an offset.
public pageSelect() : void
public register(mixed $type, mixed $blueprint=null) : void
public rewind() : void
Rewinds back to the first element of the Iterator.
public scanBlueprints(mixed $uri) : void
public scanTemplates(mixed $uri) : void
public toArray() : array
Convert object into an array.
public toJson() : string
Convert object into JSON string.
public toYaml(int $inline=3, int $indent=2) : string A YAML string representing the object.
Convert object into YAML string.
public valid() : bool Returns TRUE on success or FALSE on failure.
This method is called after Iterator::rewind() and Iterator::next() to check if the current position is valid.

This class implements \ArrayAccess, \Iterator, \Traversable, \Countable


Class: \Grav\Common\Page\Medium\AbstractMedia (abstract)

Visibility Function
public __invoke(string $filename) : mixed
Call object as function to get medium by filename.
public all() : array/\Grav\Common\Page\Medium\Medium[]
Get a list of all media.
public audios() : array/\Grav\Common\Page\Medium\Medium[]
Get a list of all audio media.
public files() : array/\Grav\Common\Page\Medium\Medium[]
Get a list of all file media.
public get(string $filename) : \Grav\Common\Page\Medium\Medium/null
Get medium by filename.
public images() : array/\Grav\Common\Page\Medium\Medium[]
Get a list of all image media.
public videos() : array/\Grav\Common\Page\Medium\Medium[]
Get a list of all video media.
protected add(string $name, \Grav\Common\Page\Medium\Medium $file) : void
protected getFileParts(string $filename) : array
Get filename, extension and meta part.

This class extends \Grav\Common\Getters

This class implements \Countable, \ArrayAccess


Class: \Grav\Common\Page\Medium\AudioMedium

Visibility Function
public reset() : \Grav\Common\Page\Medium\$this
Reset medium.
public resize(int $width=null, int $height=null) : \Grav\Common\Page\Medium\$this
Resize media by setting attributes
protected sourceParsedownElement(array $attributes, bool/boolean $reset=true) : array
Parsedown element for source display mode

This class extends \Grav\Common\Page\Medium\Medium

This class implements \Grav\Common\Page\Medium\RenderableInterface, \Grav\Common\Data\DataInterface, \ArrayAccess, \Countable, \RocketTheme\Toolbox\ArrayTraits\ExportInterface


Class: \Grav\Common\Page\Medium\GlobalMedia

Visibility Function
public offsetExists(mixed $offset) : bool
public offsetGet(mixed $offset) : mixed
protected addMedium(string $stream) : \Grav\Common\Page\Medium\Medium/null
protected resolveStream(string $filename) : string/null

This class extends \Grav\Common\Page\Medium\AbstractMedia

This class implements \ArrayAccess, \Countable


Class: \Grav\Common\Page\Medium\ImageFile

Visibility Function
public cacheFile(string $type='jpg', int $quality=80, bool $actual=false) : mixed/string
This is the same as the Gregwar Image class except this one fires a Grav Event on creation of new cached file
public clearOperations() : void
Clear previously applied operations

This class extends \Gregwar\Image\Image


Class: \Grav\Common\Page\Medium\ImageMedium

Visibility Function
public __call(string $method, mixed $args) : \Grav\Common\Page\Medium\$this/mixed
Forward the call to the image processing method.
public __construct(array $items=array(), \Grav\Common\Data\Blueprint $blueprint=null) : void
Construct.
public addMetaFile(mixed $filepath) : \Grav\Common\Page\Medium\$this
Add meta file for the medium.
public cache() : \Grav\Common\Page\Medium\$this
Simply processes with no extra methods. Useful for triggering events.
public clearAlternatives() : void
Clear out the alternatives
public derivatives(int/int[] $min_width, mixed $max_width=2500, mixed $step=200) : \Grav\Common\Page\Medium\$this
Generate alternative image widths, using either an array of integers, or a min width, a max width, and a step parameter to fill out the necessary widths. Existing image alternatives won't be overwritten.
public filter(string $filter='image.filters.default') : void
Filter image by using user defined filter parameters.
public format(string $format) : \Grav\Common\Page\Medium\$this
Sets image output format.
public getImagePrettyName() : mixed
public height(string/mixed $value='auto') : \Grav\Common\Page\Medium\$this
Allows to set the height attribute from Markdown or Twig Examples: Example Example Example Example {{ page.media['myimg.png'].width().height().html }} {{ page.media['myimg.png'].resize(100,200).width(100).height(200).html }}
public higherQualityAlternative() : ImageMedium the alternative version with higher quality
Return the image higher quality version
public lightbox(int $width=null, int $height=null, bool/boolean $reset=true) : \Grav\Common\Page\Medium\Link
Turn the current Medium into a Link with lightbox enabled
public link(bool/boolean $reset=true, array $attributes=array()) : \Grav\Common\Page\Medium\Link
Turn the current Medium into a Link
public path(bool $reset=true) : string path to image
Return PATH to image.
public quality(int $quality=null) : \Grav\Common\Page\Medium\Medium
Sets or gets the quality of the image
public reset() : \Grav\Common\Page\Medium\$this
Reset image.
public setImagePrettyName(mixed $name) : void
Allows the ability to override the Inmage's Pretty name stored in cache
public sizes(string $sizes=null) : \Grav\Common\Page\Medium\$this
Set or get sizes parameter for srcset media action
public sourceParsedownElement(array $attributes, bool/boolean $reset=true) : array
Parsedown element for source display mode
public srcset(bool $reset=true) : string
Return srcset string for this Medium and its alternatives.
public url(bool $reset=true) : string
Return URL to image.
public width(string/mixed $value='auto') : \Grav\Common\Page\Medium\$this
Allows to set the width attribute from Markdown or Twig Examples: Example Example Example Example {{ page.media['myimg.png'].width().height().html }} {{ page.media['myimg.png'].resize(100,200).width(100).height(200).html }}
protected image() : \Grav\Common\Page\Medium\$this
Gets medium image, resets image manipulation operations.
protected saveImage() : mixed/string
Save the image with cache.

This class extends \Grav\Common\Page\Medium\Medium

This class implements \Grav\Common\Page\Medium\RenderableInterface, \Grav\Common\Data\DataInterface, \ArrayAccess, \Countable, \RocketTheme\Toolbox\ArrayTraits\ExportInterface


Class: \Grav\Common\Page\Medium\Link

Visibility Function
public __call(string $method, mixed $args) : mixed
Forward the call to the source element
public __construct(array $attributes, \Grav\Common\Page\Medium\Medium $medium) : void
Construct.
public html(string $title=null, string $alt=null, string $class=null, string $id=null, bool $reset=true) : string
Return HTML markup from the medium.
public parsedownElement(string $title=null, string $alt=null, string $class=null, string $id=null, bool/boolean $reset=true) : array
Get an element (is array) that can be rendered by the Parsedown engine

This class implements \Grav\Common\Page\Medium\RenderableInterface


Class: \Grav\Common\Page\Medium\Medium

Visibility Function
public __call(string $method, mixed $args) : \Grav\Common\Page\Medium\$this
Allow any action to be called on this medium from twig or markdown
public __construct(array $items=array(), \Grav\Common\Data\Blueprint $blueprint=null) : void
Construct.
public __toString() : string
Return string representation of the object (html).
public addAlternative(mixed $ratio, \Grav\Common\Page\Medium\Medium $alternative) : void
Add alternative Medium to this Medium.
public addMetaFile(mixed $filepath) : void
Add meta file for the medium.
public classes() : \Grav\Common\Page\Medium\$this
Add a class to the element from Markdown or Twig Example: Example or Example
public display(string $mode='source') : \Grav\Common\Page\Medium\$this
Switch display mode.
public html(string $title=null, string $alt=null, string $class=null, string $id=null, bool $reset=true) : string
Return HTML markup from the medium.
public id(mixed $id) : \Grav\Common\Page\Medium\$this
Add an id to the element from Markdown or Twig Example: Example
public lightbox(int $width=null, int $height=null, bool/boolean $reset=true) : \Grav\Common\Page\Medium\Link
Turn the current Medium into a Link with lightbox enabled
public link(bool/boolean $reset=true, array $attributes=array()) : \Grav\Common\Page\Medium\Link
Turn the current Medium into a Link
public meta() : \Grav\Common\Data\Data
Return just metadata from the Medium object
public metadata() : array
Returns an array containing just the metadata
public parsedownElement(string $title=null, string $alt=null, string $class=null, string $id=null, bool/boolean $reset=true) : array
Get an element (is array) that can be rendered by the Parsedown engine
public path(bool $reset=true) : string path to file
Return PATH to file.
public querystring(string $querystring=null, bool/boolean $withQuestionmark=true) : string
Get/set querystring for the file's url
public relativePath(bool $reset=true) : mixed
Return the relative path to file
public reset() : \Grav\Common\Page\Medium\$this
Reset medium.
public style(string $style) : \Grav\Common\Page\Medium\$this
Allows to add an inline style attribute from Markdown or Twig Example: Example
public thumbnail(string $type='auto') : \Grav\Common\Page\Medium\$this
Switch thumbnail.
public url(bool $reset=true) : string
Return URL to file.
public urlHash(string $hash=null, bool/boolean $withHash=true) : string
Get/set hash for the file's url
protected getThumbnail() : \Grav\Common\Page\Medium\ThumbnailImageMedium
Get the thumbnail Medium object
protected sourceParsedownElement(array $attributes, bool/boolean $reset=true) : array
Parsedown element for source display mode
protected textParsedownElement(array $attributes, bool/boolean $reset=true) : array
Parsedown element for text display mode

This class extends \Grav\Common\Data\Data

This class implements \RocketTheme\Toolbox\ArrayTraits\ExportInterface, \Countable, \ArrayAccess, \Grav\Common\Data\DataInterface, \Grav\Common\Page\Medium\RenderableInterface


Class: \Grav\Common\Page\Medium\MediumFactory

Visibility Function
public static fromArray(array $items=array(), \Grav\Common\Page\Medium\Blueprint/null/\Grav\Common\Data\Blueprint $blueprint=null) : \Grav\Common\Page\Medium\Medium
Create Medium from array of parameters
public static fromFile(string $file, array $params=array()) : \Grav\Common\Page\Medium\Medium
Create Medium from a file
public static scaledFromMedium(\Grav\Common\Page\Medium\ImageMedium $medium, int $from, int $to) : \Grav\Common\Page\Medium\Medium
Create a new ImageMedium by scaling another ImageMedium object.


Interface: \Grav\Common\Page\Medium\RenderableInterface

Visibility Function
public html(string $title=null, string $alt=null, string $class=null, bool $reset=true) : string
Return HTML markup from the medium.
public parsedownElement(string $title=null, string $alt=null, string $class=null, string $id=null, bool $reset=true) : string
Return Parsedown Element from the medium.


Class: \Grav\Common\Page\Medium\StaticImageMedium

Visibility Function
public resize(int $width=null, int $height=null) : \Grav\Common\Page\Medium\$this
Resize media by setting attributes
protected sourceParsedownElement(array $attributes, bool/boolean $reset=true) : array
Parsedown element for source display mode

This class extends \Grav\Common\Page\Medium\Medium

This class implements \Grav\Common\Page\Medium\RenderableInterface, \Grav\Common\Data\DataInterface, \ArrayAccess, \Countable, \RocketTheme\Toolbox\ArrayTraits\ExportInterface


Class: \Grav\Common\Page\Medium\ThumbnailImageMedium

Visibility Function
public display(string $mode='source') : \Grav\Common\Page\Medium\$this
Switch display mode.
public html(string $title=null, string $alt=null, string $class=null, string $id=null, bool $reset=true) : string
Return HTML markup from the medium.
public lightbox(int $width=null, int $height=null, bool/boolean $reset=true) : \Grav\Common\Page\Medium\Link
Turn the current Medium into a Link with lightbox enabled
public link(bool/boolean $reset=true, array $attributes=array()) : \Grav\Common\Page\Medium\Link
Turn the current Medium into a Link
public parsedownElement(string $title=null, string $alt=null, string $class=null, string $id=null, bool/boolean $reset=true) : array
Get an element (is array) that can be rendered by the Parsedown engine
public srcset(bool $reset=true) : string
Return srcset string for this Medium and its alternatives.
public thumbnail(string $type='auto') : \Grav\Common\Page\Medium\$this
Switch thumbnail.
protected bubble(string $method, array $arguments=array(), bool/boolean $testLinked=true) : \Grav\Common\Page\Medium\Medium
Bubble a function call up to either the superclass function or the parent Medium instance

This class extends \Grav\Common\Page\Medium\ImageMedium

This class implements \RocketTheme\Toolbox\ArrayTraits\ExportInterface, \Countable, \ArrayAccess, \Grav\Common\Data\DataInterface, \Grav\Common\Page\Medium\RenderableInterface


Class: \Grav\Common\Page\Medium\VideoMedium

Visibility Function
public autoplay(bool $status=false) : \Grav\Common\Page\Medium\$this
Allows to set the autoplay attribute
public controls(bool $display=true) : \Grav\Common\Page\Medium\$this
Allows to set or remove the HTML5 default controls
public loop(bool $status=false) : \Grav\Common\Page\Medium\$this
Allows to set the loop attribute
public poster(mixed $urlImage) : \Grav\Common\Page\Medium\$this
Allows to set the video's poster image
public reset() : \Grav\Common\Page\Medium\$this
Reset medium.
public resize(int $width=null, int $height=null) : \Grav\Common\Page\Medium\$this
Resize media by setting attributes
protected sourceParsedownElement(array $attributes, bool/boolean $reset=true) : array
Parsedown element for source display mode

This class extends \Grav\Common\Page\Medium\Medium

This class implements \Grav\Common\Page\Medium\RenderableInterface, \Grav\Common\Data\DataInterface, \ArrayAccess, \Countable, \RocketTheme\Toolbox\ArrayTraits\ExportInterface


Class: \Grav\Common\Processors\AssetsProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Processors\ConfigurationProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Processors\DebuggerAssetsProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Processors\DebuggerInitProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Processors\ErrorsProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Processors\InitializeProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Processors\PagesProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Processors\PluginsProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Processors\ProcessorBase (abstract)

Visibility Function
public __construct(\Grav\Common\Grav $container) : void


Interface: \Grav\Common\Processors\ProcessorInterface

Visibility Function
public process() : void


Class: \Grav\Common\Processors\RenderProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Processors\SiteSetupProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Processors\TasksProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Processors\ThemesProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Processors\TwigProcessor

Visibility Function
public process() : void

This class extends \Grav\Common\Processors\ProcessorBase

This class implements \Grav\Common\Processors\ProcessorInterface


Class: \Grav\Common\Service\AssetsServiceProvider

Visibility Function
public register(\Pimple\Container $container) : void

This class implements \Pimple\ServiceProviderInterface


Class: \Grav\Common\Service\ConfigServiceProvider

Visibility Function
public static blueprints(\Pimple\Container $container) : void
public static languages(\Pimple\Container $container) : void
public static load(\Pimple\Container $container) : mixed
public register(\Pimple\Container $container) : void
public static setup(\Pimple\Container $container) : void

This class implements \Pimple\ServiceProviderInterface


Class: \Grav\Common\Service\ErrorServiceProvider

Visibility Function
public register(\Pimple\Container $container) : void

This class implements \Pimple\ServiceProviderInterface


Class: \Grav\Common\Service\LoggerServiceProvider

Visibility Function
public register(\Pimple\Container $container) : void

This class implements \Pimple\ServiceProviderInterface


Class: \Grav\Common\Service\MessagesServiceProvider

Visibility Function
public register(\Pimple\Container $container) : void

This class implements \Pimple\ServiceProviderInterface


Class: \Grav\Common\Service\OutputServiceProvider

Visibility Function
public register(\Pimple\Container $container) : void

This class implements \Pimple\ServiceProviderInterface


Class: \Grav\Common\Service\PageServiceProvider

Visibility Function
public register(\Pimple\Container $container) : void

This class implements \Pimple\ServiceProviderInterface


Class: \Grav\Common\Service\StreamsServiceProvider

Visibility Function
public register(\Pimple\Container $container) : void

This class implements \RocketTheme\Toolbox\DI\ServiceProviderInterface, \Pimple\ServiceProviderInterface


Class: \Grav\Common\Service\TaskServiceProvider

Visibility Function
public register(\Pimple\Container $container) : void

This class implements \Pimple\ServiceProviderInterface


Class: \Grav\Common\Twig\Twig

Visibility Function
public __construct(\Grav\Common\Grav $grav) : void
Constructor
public addPath(mixed $template_path, string/null $namespace='__main__') : void
Wraps the Twig_Loader_Filesystem addPath method (should be used only in onTwigLoader() event
public init() : void
Twig initialization that sets the twig loader chain, then the environment, then extensions and also the base set of twig vars
public loader() : \Twig_Loader_Filesystem
public prependPath(mixed $template_path, string/null $namespace='__main__') : void
Wraps the Twig_Loader_Filesystem prependPath method (should be used only in onTwigLoader() event
public processPage(\Grav\Common\Page\Page $item, string $content=null) : string The rendered output
Twig process that renders a page item. It supports two variations: 1) Handles modular pages by rendering a specific page based on its modular twig template 2) Renders individual page items for twig processing before the site rendering
public processSite(string $format=null, array $vars=array()) : string the rendered output
Twig process that renders the site layout. This is the main twig process that renders the overall page and handles all the layout for the site display.
public processString(string $string, array $vars=array()) : string
Process a Twig template directly by using a Twig string and optional array of variables
public processTemplate(string $template, array $vars=array()) : string
Process a Twig template directly by using a template name and optional array of variables
public setAutoescape(boolean $state) : void
Overrides the autoescape setting
public setTemplate(string $name, string $template) : void
Adds or overrides a template.
public template(string $template) : string the template name
Simple helper method to get the twig template if it has already been set, else return the one being passed in
public twig() : \Twig_Environment


Class: \Grav\Common\Twig\TwigEnvironment

Visibility Function
protected writeCacheFile(mixed $file, mixed $content) : void
This exists so template cache files use the same group between apache and cli

This class extends \Twig_Environment


Class: \Grav\Common\Twig\TwigExtension

Visibility Function
public __construct() : void
TwigExtension constructor.
public absoluteUrlFilter(mixed $string) : mixed
public arrayFunc(mixed $value) : array
Cast a value to array
public arrayIntersectFunc(mixed $array1, mixed $array2) : array
Wrapper for array_intersect() method
public arrayKeyValueFunc(string $key, string $val, string $current_array=null) : array
Workaround for twig associative array initialization Returns a key => val array
public authorize(string/array $action) : bool Returns TRUE if the user is authorized to perform the action, FALSE otherwise.
Authorize an action. Returns true if the user is logged in and has the right to execute $action. entry can be a string like 'group.action' or without dot notation an associative array.
public base32DecodeFilter(mixed $str) : bool/string
Return Base32 decoded string
public base32EncodeFilter(mixed $str) : string
Return Base32 encoded string
public base64DecodeFilter(mixed $str) : bool/string
Return Base64 decoded string
public base64EncodeFilter(mixed $str) : string
Return Base64 encoded string
public chunkSplitFilter(mixed $value, mixed $chars, string $split='-') : string
Wrapper for chunk_split() function
public containsFilter(String $haystack, String $needle) : boolean
determine if a string contains another
public definedDefaultFilter(mixed $value, null $default=null) : null
public dump(\Twig_Environment $env, mixed $context) : void
Based on Twig_Extension_Debug / twig_var_dump (c) 2011 Fabien Potencier
public endsWithFilter(mixed $haystack, mixed $needle) : bool
public evaluateStringFunc(\Twig_Environment $environment, mixed $context, mixed $string) : mixed
This function will evaluate a $string through the $environment, and return its results.
public evaluateTwigFunc(\Twig_Environment $environment, array $context, string $twig) : mixed
This function will evaluate Twig $twig through the $environment, and return its results.
public exifFunc(mixed $image, bool $raw=false) : mixed
Get's the Exif data for a file
public fieldNameFilter(string $str) : string
Filters field name by changing dot notation into array notation.
public getCookie(string $key) : mixed
Used to retrieve a cookie value
public getFilters() : array
Return a list of all filters.
public getFunctions() : array
Return a list of all functions.
public getGlobals() : array
Register some standard globals
public getName() : string
Returns extension name.
public gistFunc(string $id, bool/string $file=false) : string
Output a Gist
public inflectorFilter(string $action, string $data, int $count=null) : mixed
Inflector supports following notations: {{ 'person'|pluralize }} => people {{ 'shoes'|singularize }} => shoe {{ 'welcome page'|titleize }} => "Welcome Page" {{ 'send_email'|camelize }} => SendEmail {{ 'CamelCased'|underscorize }} => camel_cased {{ 'Something Text'|hyphenize }} => something-text {{ 'something_text_to_read'|humanize }} => "Something text to read" {{ '181'|monthize }} => 5 {{ '10'|ordinalize }} => 10th
public isAjaxFunc() : true if HTTP_X_REQUESTED_WITH exists and has been set to xmlhttprequest
Check if HTTP_X_REQUESTED_WITH has been set to xmlhttprequest, in which case we may unsafely assume ajax. Non critical use only.
public jsonDecodeFilter(string $str, bool $assoc=false, int $depth=512, int $options) : array
Decodes string from JSON.
public ksortFilter(array $array) : array
Return ksorted collection.
public ltrimFilter(mixed $value, null $chars=null) : string
public markdownFilter(mixed $string, bool $block=true) : mixed/string
public md5Filter(string $str) : string
Return MD5 hash from the input.
public mediaDirFunc(mixed $media_dir) : \Grav\Common\Page\Media
Process a folder as Media and return a media object
public modulusFilter(int $number, int $divider, array $items=null) : int
Returns the modulus of an integer
public nicetimeFilter(mixed $date, bool/mixed $long_strings=true) : boolean
displays a facebook style 'time ago' formatted date/time
public nonceFieldFunc(string $action, string $nonceParamName='nonce') : string the nonce input field
Used to add a nonce to a form. Call {{ nonce_field('action') }} specifying a string representing the action. For maximum protection, ensure that the string representing the action is as specific as possible
public static padFilter(mixed $input, mixed $pad_length, string $pad_string=' ', int $pad_type=1) : string
Pad a string to a certain length with another string
public randomStringFunc(int $count=5) : string
Generate a random string
public randomizeFilter(array $original, int $offset) : array
Returns array in a random order.
public rangeFunc(int $start, int $end=100, int $step=1) : array
Generates an array containing a range of elements, optionally stepped
public redirectFunc(string $url, int $statusCode=303) : void
redirect browser from twig
public regexReplace(mixed $subject, mixed $pattern, mixed $replace, int $limit=-1) : mixed the resulting content
Twig wrapper for PHP's preg_replace method
public repeatFunc(string $input, int $multiplier) : string
Repeat given string x times.
public rtrimFilter(mixed $value, null $chars=null) : string
public safeEmailFilter(string $str) : string
Protects email address.
public sortByKeyFilter(array $input, string $filter, array/int $direction=4) : string
Sorts a collection by key
public startsWithFilter(mixed $haystack, mixed $needle) : bool
public stringFunc(mixed $value) : string
Returns a string from a value. If the value is array, return it json encoded
public translate() : mixed
public translateArray(mixed $key, mixed $index, null $lang=null) : mixed
public translateFunc() : string
Translate a string
public translateLanguage(mixed $args, array/null/array $languages=null, bool $array_support=false, bool $html_out=false) : mixed
Translate Strings
public urlFunc(string $input, bool $domain=false) : string/null Returns url to the resource or null if resource was not found.
Return URL to the resource.
public vardumpFunc(mixed $var) : void
Dump a variable to the browser
protected parseString(\Twig_Environment $environment, array $context, string $string) : string
Sets the parser for the environment to Twig_Loader_String, and parsed the string $string.
Examples of TwigExtension::urlFunc()
{{ url('theme://images/logo.png')|default('http://www.placehold.it/150x100/f4f4f4') }}

This class extends \Twig_Extension

This class implements \Twig_ExtensionInterface


Class: \Grav\Common\User\Authentication (abstract)

Visibility Function
public static create(string $password) : string/bool
Create password hash from plaintext password.
public static verify(string $password, string $hash) : int Returns if the check fails, 1 if password matches, 2 if hash needs to be updated.
Verifies that a password matches a hash.


Class: \Grav\Common\User\Group

Visibility Function
public static groupExists(string $groupname) : bool
Checks if a group exists
public static groupNames() : array
Get the groups list
public static load(string $groupname) : object
Get a group by name
public static remove(string $groupname) : bool True if the action was performed
Remove a group
public save() : void
Save a group

This class extends \Grav\Common\Data\Data

This class implements \RocketTheme\Toolbox\ArrayTraits\ExportInterface, \Countable, \ArrayAccess, \Grav\Common\Data\DataInterface


Class: \Grav\Common\User\User

Visibility Function
public authenticate(string $password) : bool
Authenticate user. If user password needs to be updated, new information will be saved.
public authorise(string $action) : bool
DEPRECATED - use authorize()
public authorize(string $action) : bool
Checks user authorization to the action.
public avatarUrl() : string
Return the User's avatar URL
public static find(string $query, array $fields=array()) : \Grav\Common\User\User
Find a user by username, email, etc
public static load(string $username) : \Grav\Common\User\User
Load user account. Always creates user object. To check if user exists, use $this->exists().
public static remove(string $username) : bool True if the action was performed
Remove user account.
public save() : void
Save user without the username

This class extends \Grav\Common\Data\Data

This class implements \RocketTheme\Toolbox\ArrayTraits\ExportInterface, \Countable, \ArrayAccess, \Grav\Common\Data\DataInterface


Class: \Grav\Console\ConsoleCommand

Visibility Function
public clearCache(array $all=array()) : int
public composerUpdate(mixed $path, string $action='install') : void
public static getGrav() : \Grav\Common\Grav
public isGravInstance(mixed $path) : bool
public loadLocalConfig() : mixed string the local config file name. false if local config does not exist
Load the local config file
public setupConsole(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) : void
Set colors style definition for the formatter.
protected displayGPMRelease() : void
protected execute(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) : int/null/void
protected serve() : void

This class extends \Symfony\Component\Console\Command\Command


Class: \Grav\Console\Cli\BackupCommand

Visibility Function
public output(mixed $args) : void
protected configure() : void
protected serve() : int/null/void

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Cli\CleanCommand

Visibility Function
public setupConsole(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) : void
Set colors style definition for the formatter.
protected configure() : void
protected execute(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) : int/null/void

This class extends \Symfony\Component\Console\Command\Command


Class: \Grav\Console\Cli\ClearCacheCommand

Visibility Function
protected configure() : void
protected serve() : int/null/void

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Cli\ComposerCommand

Visibility Function
protected configure() : void
protected serve() : int/null/void

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Cli\InstallCommand

Visibility Function
protected configure() : void
protected serve() : int/null/void

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Cli\NewProjectCommand

Visibility Function
protected configure() : void
protected serve() : int/null/void

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Cli\SandboxCommand

Visibility Function
protected configure() : void
protected serve() : int/null/void

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Gpm\DirectInstallCommand

Visibility Function
protected configure() : void
protected serve() : bool

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Gpm\IndexCommand

Visibility Function
public filter(mixed $data) : mixed
public sort(mixed $packages) : void
protected configure() : void
protected serve() : int/null/void

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Gpm\InfoCommand

Visibility Function
protected configure() : void
protected serve() : int/null/void

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Gpm\InstallCommand

Visibility Function
public askConfirmationIfMajorVersionUpdated(mixed $package) : void
If the package is updated from an older major release, show warning and ask confirmation
public installDependencies(array $dependencies, string $type, string $message, bool $required=true) : void
Given a $dependencies list, filters their type according to $type and shows $message prior to listing them to the user. Then asks the user a confirmation prior to installing them.
public progress(mixed $progress) : void
public setGpm(mixed $gpm) : void
Allows to set the GPM object, used for testing the class
protected configure() : void
protected serve() : bool

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Gpm\SelfupgradeCommand

Visibility Function
public formatBytes(mixed $size, int $precision=2) : string
public progress(mixed $progress) : void
protected configure() : void
protected serve() : int/null/void

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Gpm\UninstallCommand

Visibility Function
protected configure() : void
protected serve() : int/null/void

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Gpm\UpdateCommand

Visibility Function
protected configure() : void
protected serve() : int/null/void

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\Gpm\VersionCommand

Visibility Function
protected configure() : void
protected serve() : int/null/void

This class extends \Grav\Console\ConsoleCommand


Class: \Grav\Console\TerminalObjects\Table

Visibility Function
public result() : void

This class extends \League\CLImate\TerminalObject\Basic\Table

This class implements \League\CLImate\TerminalObject\Basic\BasicTerminalObjectInterface


Class: \Grav\Framework\Collection\AbstractLazyCollection (abstract)

General JSON serializable collection.

Visibility Function
public jsonSerialize() : void
public reverse() : void
public shuffle() : void

This class extends \Doctrine\Common\Collections\AbstractLazyCollection

This class implements \Countable, \IteratorAggregate, \Traversable, \ArrayAccess, \Doctrine\Common\Collections\Collection, \Grav\Framework\Collection\CollectionInterface, \JsonSerializable


Class: \Grav\Framework\Collection\ArrayCollection

General JSON serializable collection.

Visibility Function
public jsonSerialize() : array
Implementes JsonSerializable interface.
public reverse() : \Grav\Framework\Collection\static
Reverse the order of the items.
public shuffle() : \Grav\Framework\Collection\static
Shuffle items.

This class extends \Doctrine\Common\Collections\ArrayCollection

This class implements \Doctrine\Common\Collections\Selectable, \Countable, \IteratorAggregate, \Traversable, \ArrayAccess, \Doctrine\Common\Collections\Collection, \Grav\Framework\Collection\CollectionInterface, \JsonSerializable


Interface: \Grav\Framework\Collection\CollectionInterface

Collection Interface.

Visibility Function
public reverse() : \Grav\Framework\Collection\static
Reverse the order of the items.
public shuffle() : \Grav\Framework\Collection\static
Shuffle items.

This class implements \Doctrine\Common\Collections\Collection, \ArrayAccess, \Traversable, \IteratorAggregate, \Countable, \JsonSerializable


Class: \Grav\Framework\Collection\FileCollection

Collection of objects stored into a filesystem.

Visibility Function
public __construct(string $path, int $flags=null) : void
public addFilter(\callable $filterFunction) : \Grav\Framework\Collection\$this
public getFlags() : int
public getNestingLimit() : int
public getPath() : string
public matching(\Doctrine\Common\Collections\Criteria $criteria) : \Grav\Framework\Collection\ArrayCollection
public setFilter(\callable $filterFunction=null) : \Grav\Framework\Collection\$this
public setIterator() : void
public setNestingLimit(mixed $limit=99) : void
public setObjectBuilder(\callable $objectFunction=null) : \Grav\Framework\Collection\$this
protected createObject(\RecursiveDirectoryIterator $file) : object
protected doInitialize() : void
protected doInitializeByIterator(\SeekableIterator $iterator, mixed $nestingLimit) : void
protected doInitializeChildren(\RecursiveDirectoryIterator[] $children, mixed $nestingLimit) : array

This class extends \Grav\Framework\Collection\AbstractLazyCollection

This class implements \JsonSerializable, \Grav\Framework\Collection\CollectionInterface, \Doctrine\Common\Collections\Collection, \ArrayAccess, \Traversable, \IteratorAggregate, \Countable