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-backend
Model
Widget
Grid
Parser.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Backend\Model\Widget\Grid
;
7
12
class
Parser
13
{
19
protected
$_operations
= [
'-'
,
'+'
,
'/'
,
'*'
];
20
27
public
function
parseExpression
($expression)
28
{
29
$stack = [];
30
$expression = trim($expression);
31
foreach
($this->_operations as $operation) {
32
$splittedExpr = preg_split(
'/\\'
. $operation .
'/'
, $expression, -1, PREG_SPLIT_DELIM_CAPTURE);
33
$count
= count($splittedExpr);
34
if
(
$count
> 1) {
35
for
(
$i
= 0;
$i
<
$count
;
$i
++) {
36
$stack = array_merge($stack, $this->
parseExpression
($splittedExpr[
$i
]));
37
if
(
$i
> 0) {
38
$stack[] = $operation;
39
}
40
}
41
break
;
42
}
43
}
44
return
empty($stack) ? [$expression] : $stack;
45
}
46
53
public
function
isOperation
($operation)
54
{
55
return
in_array($operation, $this->_operations);
56
}
57
}
Magento\Setup\Module\I18n\Parser
$count
$count
Definition:
recent.phtml:13
Magento\Backend\Model\Widget\Grid\Parser\$_operations
$_operations
Definition:
Parser.php:19
Magento\Backend\Model\Widget\Grid\Parser\parseExpression
parseExpression($expression)
Definition:
Parser.php:27
Magento\Backend\Model\Widget\Grid\Parser\isOperation
isOperation($operation)
Definition:
Parser.php:53
Magento\Backend\Model\Widget\Grid
Definition:
AbstractTotals.php:7
$i
$i
Definition:
gallery.phtml:31