Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Grids.php
Go to the documentation of this file.
1 <?php
7 
13 class Grids extends \Magento\Backend\Block\Widget\Tabs
14 {
18  protected $_template = 'Magento_Backend::widget/tabshoriz.phtml';
19 
23  protected function _construct()
24  {
25  parent::_construct();
26  $this->setId('grid_tab');
27  $this->setDestElementId('grid_tab_content');
28  }
29 
44  protected function _prepareLayout()
45  {
46  // load this active tab statically
47  $this->addTab(
48  'ordered_products',
49  [
50  'label' => __('Bestsellers'),
51  'content' => $this->getLayout()->createBlock(
52  \Magento\Backend\Block\Dashboard\Tab\Products\Ordered::class
53  )->toHtml(),
54  'active' => true
55  ]
56  );
57 
58  // load other tabs with ajax
59  $this->addTab(
60  'reviewed_products',
61  [
62  'label' => __('Most Viewed Products'),
63  'url' => $this->getUrl('adminhtml/*/productsViewed', ['_current' => true]),
64  'class' => 'ajax'
65  ]
66  );
67 
68  $this->addTab(
69  'new_customers',
70  [
71  'label' => __('New Customers'),
72  'url' => $this->getUrl('adminhtml/*/customersNewest', ['_current' => true]),
73  'class' => 'ajax'
74  ]
75  );
76 
77  $this->addTab(
78  'customers',
79  [
80  'label' => __('Customers'),
81  'url' => $this->getUrl('adminhtml/*/customersMost', ['_current' => true]),
82  'class' => 'ajax'
83  ]
84  );
85 
86  return parent::_prepareLayout();
87  }
88 }
__()
Definition: __.php:13