Class: DateHelper
Source Location: /vendor/trax/action_view/helpers/date_helper.php
Helpers
|
--DateHelper
Utility to help build HTML pulldown menus for date and time
|
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Class Methods
constructor __construct [line 114]
DateHelper __construct(
[string
$object_name = null], [string
$attribute_name = null])
|
|
Constructor Construct an instance of Helpers with the same arguments
Overrides Helpers::__construct() (Construct a Helpers object)
Parameters:
method check_request_for_value [line 136]
mixed check_request_for_value(
)
|
|
Check whether $_REQUEST holds value for this attribute Called with the name of an ActiveRecord subclass in $this->object_name and the name of one of its attributes in $this->attribute_name. Check whether $_REQUEST contains a value for this attribute; if so return it.
Tags:
method datetime_select [line 310]
string datetime_select(
[mixed[]
$options = array()])
|
|
Call to_datetime_select_tag() Alias for to_datetime_select_tag()
Tags:
Parameters:
method date_select [line 322]
string date_select(
[mixed[]
$options = array()])
|
|
Call to_date_select_tag() Alias for to_date_select_tag()
Tags:
Parameters:
method expiration_date_select [line 298]
string expiration_date_select(
[mixed[]
$options = array()])
|
|
Call to_expiration_date_select_tag() Alias for to_expiration_date_select_tag()
Tags:
Parameters:
method leading_zero_on_single_digits [line 247]
string leading_zero_on_single_digits(
string
$number)
|
|
Prefix a leading zero to single digit numbers
Tags:
Parameters:
method select_date [line 443]
string select_date(
[string
$date = null], [mixed[]
$options = array()])
|
|
Generate HTML/XML for year, month and day selector pull-down menus Returns <select>...</select> HTML with options for a number of years, months and days. The first argument, if present, specifies the initially selected date. The second argument controls the format of the generated HTML. Examples: - select_date();
Generates a group of
three pulldown menus in the order year, month and day with
the current date initially selected. - select_date('August 4, 1998');
Generates a
group of three pulldown menus in the order year, month and
day with the date August 4, 1998 initially selected.
Tags:
Parameters:
method select_datetime [line 488]
string select_datetime(
[string
$datetime = null], [mixed[]
$options = array()])
|
|
Generate HTML/XML for year-month-day-hour-minute selector pulldowns Returns <select>...</select> HTML with options for a number of years, months, days, hours and minutes. The first argument, if present, specifies the initially selected date. The second argument controls the format of the generated HTML. Examples: - select_datetime();
Generates a group of
five pulldown menus in the order year, month, day, hour and
minute with the current date and time initially
selected. - select_datetime('1998-04-08 13:21:17');
Generates a group of five pulldown menus in the order year,
month, day, hour and minute with the date/time
1998 August 4 13:21 initially selected.
Tags:
Parameters:
method select_day [line 838]
string select_day(
[string
$datetime = null], [mixed[]
$options = array()])
|
|
Generate HTML/XML for day selector pull-down menu Returns <select>...</select> HTML with an option for each of the thirty-one days. The first argument, if present, specifies the initially selected day. The second argument controls the format of the generated HTML. Examples: - select_day();
Generates menu '01', '02', ..., '31'. Initially selected
day is the day in
$request_days[$attribute_name], or if that
is not defined, the current calendar day. - select_day(null,array('include_blank' => true));
Generates menu ' ', '01', '02',..., '31'. Initially
selected day same as above.
Tags:
Parameters:
method select_expiration_date [line 366]
string select_expiration_date(
[string
$date = null], [mixed[]
$options = array()])
|
|
Generate HTML/XML for expiration month and year selector pulldowns Generates HTML for a month and year pulldown. The year pulldown has a range of years from the initially selected year to seven years after. When called, $_REQUEST[] may have initial date values in fields with default names of 'expiration_month' and 'expiration_year'. If these values exist they override the first parameter.
Tags:
Parameters:
method select_hour [line 744]
string select_hour(
[string
$datetime = null], [mixed[]
$options = array()])
|
|
Generate HTML/XML for hour selector pull-down menu Returns <select>...</select> HTML with an option for each of the twenty-four hours. The first argument, if present, specifies the initially selected hour. The second argument controls the format of the generated HTML. Examples: - select_hour();
Generates menu '00', '01', ..., '23'. Initially selected
hour is the hour in
$request_hours[$attribute_name], or if that
is not defined, the current hour. - select_hour(null,array('include_blank' => true));
Generates menu ' ', '00', '01',..., '23'. Initially
selected hour same as above.
Tags:
Parameters:
method select_html [line 226]
string select_html(
string
$type, string
$options, [string
$prefix = null], [boolean
$include_blank = false], [boolean
$discard_type = false])
|
|
Generate HTML/XML for select to enclose option list
Tags:
Parameters:
method select_minute [line 668]
string select_minute(
[string
$datetime = null], [mixed[]
$options = array()])
|
|
Generate HTML/XML for minute selector pull-down menu Returns <select>...</select> HTML with an option for each of the sixty minutes. The first argument, if present, specifies the initially selected minute. The second argument controls the format of the generated HTML. Examples: - select_minute();
Generates menu '00', '01', ..., '59'. Initially selected
minute is the minute in
$request_minutes[$attribute_name], or if that
is not defined, the current minute. - select_minute(null,array('include_blank' => true));
Generates menu ' ', '00', '01',..., '59'. Initially
selected minute same as above.
Tags:
Parameters:
method select_month [line 935]
string select_month(
[string
$date = null], [mixed[]
$options = array()])
|
|
Generate HTML/XML for month selector pull-down menu Returns <select>...</select> HTML with an option for each of the twelve months. The first argument, if present, specifies the initially selected month. The second argument controls the format of the generated HTML. Examples: - select_month(); Generates menu January,
February etc.
- select_month(null,array('use_month_number' => true));
Generates menu 1, 2 etc.
- select_month(null,array('add_month_number' => true));
Generates menu 1 - January, 2 - February etc.
Tags:
Parameters:
method select_second [line 590]
string select_second(
[string
$datetime = null], [mixed[]
$options = array()])
|
|
Generate HTML/XML for second selector pull-down menu Returns <select>...</select> HTML with an option for each of the sixty seconds. The first argument, if present, specifies the initially selected second. The second argument controls the format of the generated HTML. Examples: - select_second();
Generates menu '00', '01', ..., '59'. Initially selected
second is the second in
$request_seconds[$attribute_name], or if that
is not defined, the current second. - select_second(null,array('include_blank' => true));
Generates menu ' ', '00', '01',..., '59'. Initially
selected second same as above.
Tags:
Parameters:
method select_time [line 533]
string select_time(
[string
$datetime = null], [mixed[]
$options = array()])
|
|
Generate HTML/XML for hour, minute and second selector pull-down menus Returns <select>...</select> HTML with options for a number of hours, minutes and seconds. The first argument, if present, specifies the initially selected time. The second argument controls the format of the generated HTML. Examples: - select_time();
Generates two pulldown
menus in the order hour : minute with
the current time initially selected. - select_time('August 4, 1998 8:12');
Generates
two pulldown menus in the order hour : minute with the
time 8:12 initially selected.
Tags:
Parameters:
method select_year [line 1049]
string select_year(
[string
$date = null], [mixed[]
$options = array()])
|
|
Generate HTML/XML for year selector pull-down menu Returns <select>...</select> HTML with options for a number of years. The first argument, if present, specifies the initially selected year. The second argument controls the format of the generated HTML. Examples: - select_year();
Generates a pulldown menu with
with a range of +/- five years. If a year is specified in
$request_years[$attribute_name] then it is
selected initially, otherwise the current calendar year is
selected. - select_year(null,array('start_year' => '1900));
Generates year options from 1900 to five years after the
initially selected year, which is chosen as in the previous
example. - select_year(null,array('start_year'=>date('Y')+5, 'end_year'=>date('Y')-5);
Generates year options starting five years after the current year,
ending five years before the current year.
Tags:
Parameters:
method time_select [line 1421]
string time_select(
[mixed[]
$options = array()])
|
|
Generate HTML/XML for time pulldown When called, $object_name describes the ActiveRecord subclass and $attribute_name describes the attribute whose value will be set by the generated pull-down menu. The value to be displayed initially is from $_REQUEST if present, otherwise from the database.
Tags:
Parameters:
method to_datetime_select_tag [line 1319]
string to_datetime_select_tag(
[string
$options = array()], mixed[]
1)
|
|
Generate HTML/XML for date/time pulldown menus Returns <select>...</select> HTML with options for a number of years, months, days, hours and minutes. The first argument, if present, specifies the initially selected date. The second argument controls the format of the generated HTML. Examples: - to_datetime_select_tag();
Generates a
group of five pulldown menus in the order year, month, day,
hour and minute with the current date and time initially
selected. - to_datetime_select_tag(array('discard_second' => false);
Generates a group of six pulldown menus in the order year,
month, day, hour, minute and second with the current date
and time initially selected. - to_datetime_select_tag('1998-04-08 13:21:17');
Generates a group of five pulldown menus in the order year,
month, day, hour and minute with the date/time
1998 August 4 13:21 initially selected.
Tags:
Parameters:
method to_date_select_tag [line 1169]
string to_date_select_tag(
[mixed[]
$options = array()])
|
|
Generate HTML/XML for day/month/year selector pull-down menus When called, $object_name describes the ActiveRecord subclass and $attribute_name describes the attribute whose value will be set by the generated pull-down menus. The value to be displayed initially in each menu is from $_REQUEST if present, otherwise from the database.
Tags:
Parameters:
method to_expiration_date_select_tag [line 1394]
string to_expiration_date_select_tag(
[mixed[]
$options = array()])
|
|
Generate HTML/XML for expiration month and year pulldown. Calls to_date_select_tag() with options for month with number, followed by year starting this year and going seven years in the future.
Tags:
Parameters:
method value [line 272]
Get attribute value from $_REQUEST if there, otherwise from database When called, $object_name describes the ActiveRecord subclass and $attribute_name describes the attribute whose value is desired. An attempt is made to find the value in $_REQUEST, where it would be found after the browser POSTed a form. If no value is found there, then the database is accessed for the value. When accessing the database, the assumption is made that the ActionController object refers to a single ActiveRecord subclass object which correctly identifies the table and record containing the attribute value.
Tags:
Overridden in child classes as:
- ExDateHelper::value()
Overrides Helpers::value() (Get value of current attribute in the current ActiveRecord object)
method year_option [line 1113]
string year_option(
integer
$year, integer
$date_year)
|
|
Return one HTML/XML year option, selected if so specified
Tags:
Parameters:
method year_select [line 1470]
string year_select(
[mixed[]
$options = array()])
|
|
Generate HTML/XML for year pulldown When called, $object_name describes the ActiveRecord subclass and $attribute_name describes the attribute whose value will be set by the generated pull-down menu. The value to be displayed initially is from $_REQUEST if present, otherwise from the database.
Tags:
Parameters:
|
|