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-cms
Controller
Adminhtml
Block
Widget
Chooser.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Cms\Controller\Adminhtml\Block\Widget
;
8
9
use
Magento\Backend\App\Action\Context
;
10
use
Magento\Framework\View\LayoutFactory
;
11
use Magento\Framework\Controller\Result\RawFactory;
12
13
class
Chooser
extends
\Magento\Backend\App\Action
14
{
18
const
ADMIN_RESOURCE
=
'Magento_Widget::widget_instance'
;
19
23
protected
$layoutFactory
;
24
28
protected
$resultRawFactory
;
29
35
public
function
__construct
(
Context
$context,
LayoutFactory
$layoutFactory
, RawFactory
$resultRawFactory
)
36
{
37
$this->layoutFactory =
$layoutFactory
;
38
$this->resultRawFactory =
$resultRawFactory
;
39
parent::__construct($context);
40
}
41
47
public
function
execute
()
48
{
50
$layout = $this->layoutFactory->create();
51
52
$uniqId = $this->
getRequest
()->getParam(
'uniq_id'
);
53
$pagesGrid = $layout->createBlock(
54
\
Magento
\Cms\
Block
\Adminhtml\
Block
\Widget\Chooser::class,
55
''
,
56
[
'data'
=> [
'id'
=> $uniqId]]
57
);
58
60
$resultRaw = $this->resultRawFactory->create();
61
$resultRaw->setContents($pagesGrid->toHtml());
62
return
$resultRaw;
63
}
64
}
Magento\Framework\View\LayoutFactory
Definition:
LayoutFactory.php:11
Magento\Cms\Controller\Adminhtml\Block\Widget\Chooser
Definition:
Chooser.php:13
Magento\Cms\Controller\Adminhtml\Block\Widget
Definition:
Chooser.php:7
Magento\Cms\Controller\Adminhtml\Block\Widget\Chooser\$layoutFactory
$layoutFactory
Definition:
Chooser.php:23
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento\Cms\Model\Block
Definition:
Block.php:18
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Backend\App\Action
Definition:
Action.php:17
Magento\Cms\Controller\Adminhtml\Block\Widget\Chooser\__construct
__construct(Context $context, LayoutFactory $layoutFactory, RawFactory $resultRawFactory)
Definition:
Chooser.php:35
Magento\Cms\Controller\Adminhtml\Block\Widget\Chooser\$resultRawFactory
$resultRawFactory
Definition:
Chooser.php:28
Magento\Cms\Controller\Adminhtml\Block\Widget\Chooser\ADMIN_RESOURCE
const ADMIN_RESOURCE
Definition:
Chooser.php:18
Magento
Magento\Backend\App\Action\Context
Definition:
Context.php:25