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-reports
Block
Adminhtml
Config
Form
Field
YtdStart.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Reports\Block\Adminhtml\Config\Form\Field
;
7
8
use
Magento\Framework\Data\Form\Element\AbstractElement
;
9
15
class
YtdStart
extends
\Magento\Config\Block\System\Config\Form\Field
16
{
22
protected
function
_getElementHtml
(
AbstractElement
$element
)
23
{
24
$_months = [];
25
for
(
$i
= 1;
$i
<= 12;
$i
++) {
26
$_months[
$i
] = $this->_localeDate->date(mktime(
null
,
null
,
null
,
$i
, 1))->format(
'm'
);
27
}
28
$_days = [];
29
for
(
$i
= 1;
$i
<= 31;
$i
++) {
30
$_days[
$i
] =
$i
< 10 ?
'0'
.
$i
:
$i
;
31
}
32
33
if
(
$element
->getValue()) {
34
$values
= explode(
','
,
$element
->getValue());
35
}
else
{
36
$values
= [];
37
}
38
39
$element
->setName(
$element
->getName() .
'[]'
);
40
41
$_monthsHtml =
$element
->setStyle(
42
'width:100px;'
43
)->setValues(
44
$_months
45
)->setValue(
46
isset(
$values
[0]) ?
$values
[0] :
null
47
)->getElementHtml();
48
49
$_daysHtml =
$element
->setStyle(
50
'width:50px;'
51
)->setValues(
52
$_days
53
)->setValue(
54
isset(
$values
[1]) ?
$values
[1] :
null
55
)->getElementHtml();
56
57
return
sprintf(
'%s %s'
, $_monthsHtml, $_daysHtml);
58
}
59
}
$values
$values
Definition:
options.phtml:88
Magento\Reports\Block\Adminhtml\Config\Form\Field
Definition:
MtdStart.php:6
Magento\Reports\Block\Adminhtml\Config\Form\Field\YtdStart\_getElementHtml
_getElementHtml(AbstractElement $element)
Definition:
YtdStart.php:22
Magento\Reports\Block\Adminhtml\Config\Form\Field\YtdStart
Definition:
YtdStart.php:15
$i
$i
Definition:
gallery.phtml:31
Magento\Framework\Data\Form\Element\AbstractElement
Definition:
AbstractElement.php:21
$element
$element
Definition:
element.phtml:12