silverstripe-framework/view/TemplateGlobalProvider.php
Sam Minnee 3ee8f505b7 MINORE: Remove training whitespace.
The main benefit of this is so that authors who make use of
.editorconfig don't end up with whitespace changes in their PRs.

Spaces vs. tabs has been left alone, although that could do with a
tidy-up in SS4 after the switch to PSR-1/2.

The command used was this:

for match in '*.ss' '*.css' '*.scss' '*.html' '*.yml' '*.php' '*.js' '*.csv' '*.inc' '*.php5'; do
	find . -path ./thirdparty -not -prune -o -path ./admin/thirdparty -not -prune -o -type f -name "$match" -exec sed -E -i '' 's/[[:space:]]+$//' {} \+
	find . -path ./thirdparty -not -prune -o -path ./admin/thirdparty -not -prune -o -type f -name "$match" | xargs perl -pi -e 's/ +$//'
done
2016-01-07 10:15:54 +13:00

36 lines
1.3 KiB
PHP

<?php
/**
* Interface that is implemented by any classes that want to expose a method that can be called in any
* scope in a template.
*
* Director::AbsoluteBaseURL is an example of this.
*
* @package framework
* @subpackage core
*/
interface TemplateGlobalProvider {
/**
* Called by SSViewer to get a list of global variables to expose to the template, the static method to call on
* this class to get the value for those variables, and the class to use for casting the returned value for use
* in a template
*
* If the method to call is not included for a particular template variable, a method named the same as the
* template variable will be called
*
* If the casting class is not specified for a particular template variable, ViewableData::$default_cast is used
*
* The first letter of the template variable is case-insensitive. However the method name is always case sensitive.
*
* @abstract
* @return array Returns an array of items. Each key => value pair is one of three forms:
* - template name (no key)
* - template name => method name
* - template name => array(), where the array can contain these key => value pairs
* - "method" => method name
* - "casting" => casting class to use (i.e., Varchar, HTMLText, etc)
*/
public static function get_template_global_variables();
}