Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Grid.php
Go to the documentation of this file.
1 <?php
7 
14 class Grid extends \Magento\Cms\Block\Adminhtml\Page\Grid
15 {
21  public function _construct()
22  {
23  parent::_construct();
24  $this->setUseAjax(true);
25  }
26 
32  protected function _prepareMassaction()
33  {
34  return $this;
35  }
36 
42  protected function _prepareColumns()
43  {
44  $this->addColumn('title', ['header' => __('Title'), 'align' => 'left', 'index' => 'title']);
45 
46  $this->addColumn('identifier', ['header' => __('URL Key'), 'align' => 'left', 'index' => 'identifier']);
47 
48  if (!$this->_storeManager->isSingleStoreMode()) {
49  $this->addColumn(
50  'store_id',
51  [
52  'header' => __('Store View'),
53  'index' => 'store_id',
54  'type' => 'store',
55  'store_all' => true,
56  'store_view' => true,
57  'sortable' => false,
58  'filter_condition_callback' => [$this, '_filterStoreCondition']
59  ]
60  );
61  }
62 
63  $this->addColumn(
64  'is_active',
65  [
66  'header' => __('Status'),
67  'index' => 'is_active',
68  'type' => 'options',
69  'options' => $this->_cmsPage->getAvailableStatuses()
70  ]
71  );
72 
73  return $this;
74  }
75 
81  public function getGridUrl()
82  {
83  return $this->getUrl('adminhtml/*/cmsPageGrid', ['_current' => true]);
84  }
85 
92  public function getRowUrl($row)
93  {
94  return $this->getUrl('adminhtml/*/edit', ['cms_page' => $row->getId()]);
95  }
96 }
__()
Definition: __.php:13