Code sets are often used to present user data entry choices rather than hardcode specific values in application source code. Web pages and other documents often need to display codefied database values as human readable descriptions.
CodeKit makes this a snap to program. You can see the PHP method calls to CodeKit that produce these HTML select elements from database code sets.
This page shows off the CodeKit code select functions. Select various combinations of countries and months then click [Test CodeKit] at the bottom to see the selected codes:
Have fun!
Pass in a specific code value.
print $codekit->select('currency', array( 'value' => $mycurrency ));
Currency? Austrian Schillings Belgian Francs Canadian Dollars Deutsche Marks Spanish Pesetas French Francs United Kingdom Pounds Irish Punts Italian Lire Japanese Yen Dutch Guilders United States Dollars
Constrain choices to the weekdays (1-5). A blank separator displays them all on one line.
print $codekit->radio('day', array( 'subset' => array(1, 2, 3, 4, 5), 'sep' => '' ));
MondayTuesdayWednesdayThursdayFriday
Specify a window scrolling size of 10.
Experiment with Ctrl-click and Shift-click. to select multiple countries.
print $codekit->multiple('country', array( 'size' => 10 ));
United Arab Emirates Antigua and Barbuda Netherlands Antilles Argentina Austria Australia Barbados Belgium Bermuda Brazil Bahamas Canada Switzerland Chile China Colombia Costa Rica Cuba Czech Republic Germany Denmark Dominican Republic Ecuador Egypt Spain Ethiopia Finland France United Kingdom Grenada Guadeloupe Greece Guatemala Guam Hong Kong SAR, PRC Honduras Hungary Indonesia Republic of Ireland Israel Iceland Italy Jamaica Japan Kenya Cambodia Saint Kitts and Nevis South Korea Kuwait Laos Lebanon Sri Lanka Luxembourg Morocco Monaco Macau Montserrat Malawi Mexico Malaysia Nigeria Nicaragua Netherlands, The Norway New Zealand Peru Philippines Poland Puerto Rico Portugal Russian Federation Sweden Singapore Turks and Caicos Islands Thailand Turkey Trinidad and Tobago Taiwan Region Tanzania United States Uruguay Saint Vincent and the Grenadines Venezuela Virgin Islands (British) Virgin Islands (US) Vietnam South Africa
Simple no frills method call.
print $codekit->checkbox('month');
January February March April May June July August September October November December