Class \Prado\Util\Behaviors\TTimeZoneParameterBehavior
TTimeZoneParameterBehavior class.
TTimeZoneParameterBehavior sets the date_default_timezone_set. This parameterizes the TimeZone. TimeZoneParameter is the key to the Application Parameter for setting the TimeZone.
This Behavior is designed to attach to TApplication, but can be attached to any TComponent.
<behavior name="TimeZoneParameter" Class="Prado\Util\Behaviors\TTimeZoneParameterBehavior" AttachTo="Application" TimeZoneParameter="TimeZone" TimeZone="America/New_York"/>
This code will set the default timeZone to "America/New_York", and then if there is any Application Parameter in "TimeZone", then that takes precedence. Setting the TimeZoneParameter to "" will disable the parameter functionality and set the TimeZone from the attribute TimeZone.
This routes changes in the Application Parameter TimeZoneParameter to setTimeZone. The default TimeZoneParameter is 'prop:TimeZone'.
Class hierarchy
- \Prado\Util\Behaviors\TTimeZoneParameterBehavior
- \Prado\Util\TBehavior implements IBehavior
- \Prado\Util\TBaseBehavior implements IBaseBehavior uses TPriorityPropertyTrait
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 4.2.0
public
|
attach(object $owner) : mixed
This sets the date_default_timezone_set with the value of the TimeZoneParameter
in the application parameters. It attaches the Application Parameter handler behavior.
|
public
|
|
public
|
|
public
|
|
public
|
setEnabled(bool $enabled) : mixed
This attaches and detaches the routing behavior on the Application Parameters.
|
public
|
|
public
|
public
mixed
|
APP_PARAM_ROUTE_BEHAVIOR_NAME
Name of the Application Parameter Routing Behavior
|
'TimeZoneParameter'
|
public
mixed
|
TIMEZONE_PARAMETER_NAME
Default TimeZoneParameter
|
'prop:TimeZone'
|
\Prado\TApplicationComponent::FX_CACHE_FILE, \Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |