AtkDateTimeNewAttribute: Difference between revisions
Appearance
New page: {{howto|Advanced|yotmv <brian@bcm.nu>}} This is a modified version of the atkDateTimeAttribute to handle setting default values on the fly. The parameters for it are passed as arrays... |
No edit summary |
||
| Line 6: | Line 6: | ||
The formatting for calling the new constructor within the node is: | The formatting for calling the new constructor within the node is: | ||
<syntaxhighlight lang="php"> | |||
($name, $default_date_arg( $format_edit, $format_view, $date_min, $date_max ), $default_time_arg( $beginTime, $endTime, $steps, $default ), $flags) | ($name, $default_date_arg( $format_edit, $format_view, $date_min, $date_max ), $default_time_arg( $beginTime, $endTime, $steps, $default ), $flags) | ||
</syntaxhighlight> | |||
Example: | Example: | ||
<syntaxhighlight lang="php"> | |||
$this->add(new atkDateTimeNewAttribute("sampleTime", array('','D M j','',''), array('0','23',array('0','15','30','45'),''), AF_FORCE_LOAD|AF_OBLIGATORY)); | $this->add(new atkDateTimeNewAttribute("sampleTime", array('','D M j','',''), array('0','23',array('0','15','30','45'),''), AF_FORCE_LOAD|AF_OBLIGATORY)); | ||
</syntaxhighlight> | |||
Revision as of 16:20, 3 November 2008
|
ATK Howto: AtkDateTimeNewAttribute
|
This is a modified version of the atkDateTimeAttribute to handle setting default values on the fly. The parameters for it are passed as arrays containing the necessary values
The formatting for calling the new constructor within the node is:
($name, $default_date_arg( $format_edit, $format_view, $date_min, $date_max ), $default_time_arg( $beginTime, $endTime, $steps, $default ), $flags)
Example:
$this->add(new atkDateTimeNewAttribute("sampleTime", array('','D M j','',''), array('0','23',array('0','15','30','45'),''), AF_FORCE_LOAD|AF_OBLIGATORY));