Source for file integer.php
Documentation is available at integer.php
* @package Joomla.Platform
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* Form Field class for the Joomla Platform.
* Provides a select list of integers with specified first, last and step values.
* @package Joomla.Platform
protected $type =
'Integer';
* Method to get the field options.
* @return array The field option objects.
// Initialize some field attributes.
$first = (int)
$this->element['first'];
$last = (int)
$this->element['last'];
$step = (int)
$this->element['step'];
// Step of 0 will create an endless loop.
elseif ($first <
$last &&
$step <
0)
// A negative step will never reach the last number.
elseif ($first >
$last &&
$step >
0)
// A position step will never reach the last number.
// Build the options array backwards.
for ($i =
$first; $i >=
$last; $i +=
$step)
$options[] =
JHtml::_('select.option', $i);
// Build the options array.
for ($i =
$first; $i <=
$last; $i +=
$step)
$options[] =
JHtml::_('select.option', $i);
// Merge any additional options in the XML definition.
Documentation generated on Tue, 19 Nov 2013 15:05:48 +0100 by phpDocumentor 1.4.3