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-translation
Controller
Ajax
Index.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Translation\Controller\Ajax
;
8
9
class
Index
extends
\Magento\Framework\App\Action\Action
10
{
14
protected
$inlineParser
;
15
20
public
function
__construct
(
21
\
Magento
\Framework\
App
\Action\
Context
$context,
22
\
Magento
\Framework\Translate\
Inline
\ParserInterface
$inlineParser
23
) {
24
parent::__construct($context);
25
26
$this->inlineParser =
$inlineParser
;
27
}
28
34
public
function
execute
()
35
{
36
$translate = (array)$this->
getRequest
()->getPost(
'translate'
);
37
38
try
{
39
$response
= $this->inlineParser->processAjaxPost($translate);
40
}
catch
(\Exception $e) {
41
$response
=
"{error:true,message:'"
. $e->getMessage() .
"'}"
;
42
}
43
$this->
getResponse
()->representJson(json_encode(
$response
));
44
$this->_actionFlag->set(
''
, self::FLAG_NO_POST_DISPATCH,
true
);
45
}
46
}
$response
$response
Definition:
404.php:11
Magento\Framework\App
Magento\Framework\Translate\Inline
Definition:
ConfigInterface.php:6
Magento\Translation\Controller\Ajax\Index\__construct
__construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\Translate\Inline\ParserInterface $inlineParser)
Definition:
Index.php:20
Magento\Framework\App\Action\AbstractAction\getResponse
getResponse()
Definition:
AbstractAction.php:70
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento\Translation\Controller\Ajax
Definition:
Index.php:7
Magento
Context
Definition:
ClassesForConstructorIntegrity.php:33
Magento\Translation\Controller\Ajax\Index\execute
execute()
Definition:
Index.php:34
Magento\Translation\Controller\Ajax\Index
Definition:
Index.php:9
Magento\Framework\App\Action\Action
Definition:
Action.php:25
Magento\Translation\Controller\Ajax\Index\$inlineParser
$inlineParser
Definition:
Index.php:14