Development Core Country
From Cloudrexx Development Wiki
Description
The Counry class provides a set of methods (mostly static) to display, interact and manage the country database.
Documentation
Example
- Generate a HTML-select dropdown menu
// fetch pre-selected value from POST data
$countryId = contrexx_input2raw($_POST['country_id']);
// output HTML-select dropdown
print \Cx\Core\Country\Controller\Country::getMenu('country_id', $countryId);
- Generate a custom HTML-select dropdown menu
// fetch pre-selected value from POST data
$countryId = contrexx_input2raw($_POST['country_id']);
// build HTML-select
$htmlSelectDropDown = '<select name="country_id">'
$htmlSelectDropDown .= \Cx\Core\Country\Controller\Country::getMenuoptions($countryId);
$htmlSelectDropDown .= '</select>'
// output HTML-select dropdown
print $htmlSelectDropDown