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-payment
Block
Form.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Payment\Block
;
7
8
use
Magento\Payment\Model\MethodInterface
;
9
16
class
Form
extends
\Magento\Framework\View\Element\Template
17
{
24
public
function
getMethod
()
25
{
26
$method
= $this->
getData
(
'method'
);
27
28
if
(!
$method
instanceof
MethodInterface
) {
29
throw
new \Magento\Framework\Exception\LocalizedException(
30
__
(
'We cannot retrieve the payment method model object.'
)
31
);
32
}
33
return
$method
;
34
}
35
42
public
function
setMethod
(
MethodInterface
$method
)
43
{
44
$this->
setData
(
'method'
, $method);
45
return
$this;
46
}
47
53
public
function
getMethodCode
()
54
{
55
return
$this->
getMethod
()->getCode();
56
}
57
64
public
function
getInfoData
($field)
65
{
66
return
$this->
escapeHtml
($this->
getMethod
()->getInfoInstance()->
getData
($field));
67
}
68
}
Magento\Framework\DataObject\getData
getData($key='', $index=null)
Definition:
DataObject.php:119
Magento\Payment\Block\Form
Definition:
Form.php:16
__
__()
Definition:
__.php:13
Magento\Framework\View\Element\AbstractBlock\escapeHtml
escapeHtml($data, $allowedTags=null)
Definition:
AbstractBlock.php:890
Magento\Payment\Model\MethodInterface
Definition:
MethodInterface.php:16
$method
$method
Definition:
info.phtml:13
Magento\Framework\View\Element\Template
Definition:
Template.php:32
Magento\Framework\DataObject\setData
setData($key, $value=null)
Definition:
DataObject.php:72
Magento\Payment\Block\Form\getMethod
getMethod()
Definition:
Form.php:24
Magento\Payment\Block
Definition:
InfoTest.php:6
Magento\Payment\Block\Form\setMethod
setMethod(MethodInterface $method)
Definition:
Form.php:42
Magento\Payment\Block\Form\getInfoData
getInfoData($field)
Definition:
Form.php:64
Magento\Payment\Block\Form\getMethodCode
getMethodCode()
Definition:
Form.php:53