1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* ZfTable ( Module for Zend Framework 2) |
4
|
|
|
* |
5
|
|
|
* @copyright Copyright (c) 2013 Piotr Duda [email protected] |
6
|
|
|
* @license MIT License |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace ZfTable\Example\TableExample; |
10
|
|
|
|
11
|
|
|
use ZfTable\AbstractTable; |
12
|
|
|
|
13
|
|
View Code Duplication |
class Base extends AbstractTable |
|
|
|
|
14
|
|
|
{ |
15
|
|
|
|
16
|
|
|
protected $config = array( |
17
|
|
|
'name' => 'Base table', |
18
|
|
|
'showPagination' => true, |
19
|
|
|
'showQuickSearch' => false, |
20
|
|
|
'showItemPerPage' => true, |
21
|
|
|
'itemCountPerPage' => 10, |
22
|
|
|
'showColumnFilters' => false, |
23
|
|
|
'showExportToCSV' => false, |
24
|
|
|
'valuesOfItemPerPage' => array(5, 10, 20, 50 , 100 , 200), |
25
|
|
|
'rowAction' => '' |
26
|
|
|
); |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var array Definition of headers |
30
|
|
|
*/ |
31
|
|
|
protected $headers = array( |
32
|
|
|
'idcustomer' => array('title' => 'Id', 'width' => '50') , |
33
|
|
|
'name' => array('title' => 'Name' ), |
34
|
|
|
'surname' => array('title' => 'Surname' ), |
35
|
|
|
'street' => array('title' => 'Street'), |
36
|
|
|
'city' => array('title' => 'City' ), |
37
|
|
|
'active' => array('title' => 'Active' , 'width' => 100 ), |
38
|
|
|
); |
39
|
|
|
|
40
|
|
|
public function init() |
41
|
|
|
{ |
42
|
|
|
|
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
protected function initFilters(\Zend\Db\Sql\Select $query) |
46
|
|
|
{ |
47
|
|
|
|
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.