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
zendframework1
library
Zend
Filter
NormalizedToLocalized.php
Go to the documentation of this file.
1
<?php
25
#require_once 'Zend/Filter/Interface.php';
26
30
#require_once 'Zend/Locale/Format.php';
31
40
class
Zend_Filter_NormalizedToLocalized
implements
Zend_Filter_Interface
41
{
45
protected
$_options
= array(
46
'locale'
=>
null
,
47
'date_format'
=>
null
,
48
'precision'
=>
null
49
);
50
56
public
function
__construct
(
$options
=
null
)
57
{
58
if
(
$options
instanceof
Zend_Config
) {
59
$options
=
$options
->toArray();
60
}
61
62
if
(
null
!==
$options
) {
63
$this->
setOptions
(
$options
);
64
}
65
}
66
72
public
function
getOptions
()
73
{
74
return
$this->_options
;
75
}
76
83
public
function
setOptions
(array
$options
=
null
)
84
{
85
$this->_options =
$options
+
$this->_options
;
86
return
$this;
87
}
88
97
public
function
filter
(
$value
)
98
{
99
if
(is_array(
$value
)) {
100
#require_once 'Zend/Date.php';
101
$date =
new
Zend_Date
(
$value
, $this->_options[
'locale'
]);
102
return
$date->toString($this->_options[
'date_format'
]);
103
}
else
if
($this->_options[
'precision'
] === 0) {
104
return
Zend_Locale_Format::toInteger
(
$value
, $this->_options);
105
}
else
if
($this->_options[
'precision'
] ===
null
) {
106
return
Zend_Locale_Format::toFloat
(
$value
, $this->_options);
107
}
108
109
return
Zend_Locale_Format::toNumber
(
$value
, $this->_options);
110
}
111
}
Zend_Filter_NormalizedToLocalized
Definition:
NormalizedToLocalized.php:40
Zend_Filter_NormalizedToLocalized\filter
filter($value)
Definition:
NormalizedToLocalized.php:97
Zend_Locale_Format\toFloat
static toFloat($value, array $options=array())
Definition:
Format.php:659
Zend_Filter_NormalizedToLocalized\$_options
$_options
Definition:
NormalizedToLocalized.php:45
Zend_Filter_NormalizedToLocalized\__construct
__construct($options=null)
Definition:
NormalizedToLocalized.php:56
$value
$value
Definition:
gender.phtml:16
Zend_Filter_NormalizedToLocalized\setOptions
setOptions(array $options=null)
Definition:
NormalizedToLocalized.php:83
Zend_Filter_NormalizedToLocalized\getOptions
getOptions()
Definition:
NormalizedToLocalized.php:72
Zend_Filter_Interface
Definition:
Interface.php:30
Zend_Locale_Format\toInteger
static toInteger($value, array $options=array())
Definition:
Format.php:707
Zend_Date
Zend_Config
Zend_Locale_Format\toNumber
static toNumber($value, array $options=array())
Definition:
Format.php:300
$options
$options
Definition:
multiple_mixed_products.php:29