Public Member Functions | |
countryRegionAction () |
Definition at line 32 of file JsonController.php.
countryRegionAction | ( | ) |
Definition at line 34 of file JsonController.php.
00035 { 00036 $arrRes = array(); 00037 00038 $countryId = $this->getRequest()->getParam('parent'); 00039 $arrRegions = Mage::getResourceModel('directory/region_collection') 00040 ->addCountryFilter($countryId) 00041 ->load() 00042 ->toOptionArray(); 00043 00044 if (!empty($arrRegions)) { 00045 foreach ($arrRegions as $region) { 00046 $arrRes[] = $region; 00047 } 00048 } 00049 00050 $this->getResponse()->setBody(Zend_Json::encode($arrRes)); 00051 }