How do you make a fake table. I need a select input which has 5 options (0-5, 5-10, 10-15, 15-20, 20+) as options and this will never change so it seem overkill to make a db table just for that.
I also need to validate against the submitted data for valid option so what would be the best way to approach this? The select options will be used in various places also.
I figured it would be easy enough to just define a set var in app_model like $_select_options = array( ‘0-5’, ‘5-10’, ‘10-15’, ‘15-20’, ‘20+’);
Then place $_select_options into the form and simply validate with in_array( $submitted[‘Model’][‘data’], $_select_options);
Ideas?
Thanks
Dave
No comments:
Post a Comment