TL; DR:
echo $this->Form->input('whatever', array( 'type'=>'select', 'options'=>array_combine(range(1,100), range(1,100)) ));
Explanation:
PHP range creates the array of numbers (or letters) that you want for your options. But if you use range yourself, it creates:
array(1,2,3,4...
This will give you a dropdown number, but the values will start from zero regardless of the number displayed - in this case you will get array(0=>1, 1=>2 ...
If you really want this:
array(1=>1, 2=>2, 3=>3 ...
Using array_combine , it simply makes the first option have the same value as the displayed number.
(obviously, you can write this in 1 line - I just broke it for readability)
source share