Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Selector.php
Go to the documentation of this file.
1 <?php
7 
9 {
16  protected $_modes;
17 
21  protected $_template = 'Magento_UrlRewrite::selector.phtml';
22 
28  protected function _construct()
29  {
30  $this->_modes = [
31  'id' => __('Custom'),
32  'category' => __('For Category'),
33  'product' => __('For Product'),
34  'cms_page' => __('For CMS page'),
35  ];
36  }
37 
43  public function getModes()
44  {
45  return $this->_modes;
46  }
47 
53  public function getSelectorLabel()
54  {
55  return __('Create URL Rewrite');
56  }
57 
64  public function isMode($mode)
65  {
66  return $this->getRequest()->has($mode);
67  }
68 
74  public function getDefaultMode()
75  {
76  $keys = array_keys($this->_modes);
77  return array_shift($keys);
78  }
79 
86  public function getModeUrl($mode)
87  {
88  return $this->getUrl('adminhtml/*/*') . $mode;
89  }
90 }
__()
Definition: __.php:13
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
Definition: grid.phtml:15