Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-directory
Controller
Adminhtml
Json
CountryRegion.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Directory\Controller\Adminhtml\Json
;
8
9
class
CountryRegion
extends
\Magento\Backend\App\Action
10
{
16
public
function
execute
()
17
{
18
$arrRes = [];
19
20
$countryId = $this->
getRequest
()->getParam(
'parent'
);
21
if
(!empty($countryId)) {
22
$arrRegions = $this->_objectManager->create(
23
\
Magento
\Directory\Model\
ResourceModel
\Region\Collection::class
24
)->addCountryFilter(
25
$countryId
26
)->load()->toOptionArray();
27
28
if
(!empty($arrRegions)) {
29
foreach
($arrRegions as $region) {
30
$arrRes[] = $region;
31
}
32
}
33
}
34
$this->
getResponse
()->representJson(
35
$this->_objectManager->get(\
Magento
\Framework\Json\Helper\Data::class)->jsonEncode($arrRes)
36
);
37
}
38
}
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
Magento\Framework\App\Action\AbstractAction\getResponse
getResponse()
Definition:
AbstractAction.php:70
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento\Backend\App\Action
Definition:
Action.php:17
Magento\Directory\Controller\Adminhtml\Json
Definition:
CountryRegion.php:7
Magento
Magento\Directory\Controller\Adminhtml\Json\CountryRegion
Definition:
CountryRegion.php:9
Magento\Directory\Controller\Adminhtml\Json\CountryRegion\execute
execute()
Definition:
CountryRegion.php:16