Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Range.php
Go to the documentation of this file.
1 <?php
13 
18 class Range extends \Magento\Backend\Block\Widget\Grid\Column\Filter\AbstractFilter
19 {
23  public function getHtml()
24  {
25  $html = '<div class="range"><div class="range-line">' .
26  '<input type="text" name="' .
27  $this->_getHtmlName() .
28  '[from]" id="' .
29  $this->_getHtmlId() .
30  '_from" placeholder="' .
31  __(
32  'From'
33  ) . '" value="' . $this->getEscapedValue(
34  'from'
35  ) . '" class="input-text admin__control-text no-changes" ' . $this->getUiId(
36  'filter',
37  $this->_getHtmlName(),
38  'from'
39  ) . '/></div>';
40  $html .= '<div class="range-line">' .
41  '<input type="text" name="' .
42  $this->_getHtmlName() .
43  '[to]" id="' .
44  $this->_getHtmlId() .
45  '_to" placeholder="' .
46  __(
47  'To'
48  ) . '" value="' . $this->getEscapedValue(
49  'to'
50  ) . '" class="input-text admin__control-text no-changes" ' . $this->getUiId(
51  'filter',
52  $this->_getHtmlName(),
53  'to'
54  ) . '/></div></div>';
55  return $html;
56  }
57 
62  public function getValue($index = null)
63  {
64  if ($index) {
65  return $this->getData('value', $index);
66  }
67  $value = $this->getData('value');
68  if (isset($value['from']) && strlen($value['from']) > 0 || isset($value['to']) && strlen($value['to']) > 0) {
69  return $value;
70  }
71  return null;
72  }
73 
77  public function getCondition()
78  {
79  $value = $this->getValue();
80  return $value;
81  }
82 }
getData($key='', $index=null)
Definition: DataObject.php:119
getUiId($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null)
__()
Definition: __.php:13
$value
Definition: gender.phtml:16
$index
Definition: list.phtml:44