FluentDirectorExtension
class FluentDirectorExtension extends Extension (View source)
Fluent extension for {@link \SilverStripe\Control\Director} to apply routing rules for locales
Traits
Provides extensions to this object to integrate it with standard config API methods.
Properties
static private bool | $detect_locale | Determine if the site should detect the browser locale for new users. Turn this off to disable 302 redirects on the home page. |
|
static private bool | $remember_locale | Determine if the locale should be remembered across multiple sessions via cookies. If this is left on then visitors to the home page will be redirected to the locale they last viewed. This may interefere with some applications and can be turned off to prevent unexpected redirects. |
|
static private string | $query_param | Request parameter to store the locale in |
|
static private bool | $disable_default_prefix | Allow the prefix for the default {@link Locale} (IsDefault = 1) to be disabled. |
|
static private bool | $force_domain | Whether to force "domain mode" |
|
Director | $owner |
Methods
Called when this extension is added to a particular class
Temporarily modify the owner. The original owner is ensured to be restored
Clear the current owner, and restore extension to the state prior to the last setOwner()
Helper method to strip eval'ed arguments from a string that's passed to {@link DataObject::$extensions} or {@link Object::add_extension()}.
Invoke extension point. This will prefer explicit extend
prefixed
methods.
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
Gets the uninherited value for the given config option
Forces regeneration of all locale routes
Details
__construct()
static
add_to_class(string $class, string $extensionClass, mixed $args = null)
Called when this extension is added to a particular class
setOwner(object $owner)
Set the owner of this extension.
mixed
withOwner(mixed $owner, callable $callback, array $args = [])
Temporarily modify the owner. The original owner is ensured to be restored
clearOwner()
Clear the current owner, and restore extension to the state prior to the last setOwner()
object
getOwner()
Returns the owner of this extension.
static string
get_classname_without_arguments(string $extensionStr)
Helper method to strip eval'ed arguments from a string that's passed to {@link DataObject::$extensions} or {@link Object::add_extension()}.
mixed
invokeExtension(object $owner, string $method, array ...$arguments)
Invoke extension point. This will prefer explicit extend
prefixed
methods.
static Config_ForClass
config()
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
mixed
uninherited(string $name)
Gets the uninherited value for the given config option
updateRules(array $rules)
Forces regeneration of all locale routes