Completed
Push — master ( 481507...e81850 )
by Denis
01:52
created

BaseRenderer::render()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
nc 1
dl 0
loc 1
c 0
b 0
f 0
1
<?php
2
3
namespace Woo\GridView\Renderers;
4
5
use Woo\GridView\GridView;
6
use Woo\GridView\Traits\Configurable;
7
8
abstract class BaseRenderer
9
{
10
    use Configurable;
11
12
    /**
13
     * HTML ID of container
14
     * @var string
15
     */
16
    public $id = '';
17
18
    /**
19
     * BaseRenderer constructor.
20
     * @param $config
21
     * @throws \Woo\GridView\Exceptions\GridViewConfigException
22
     */
23
    public function __construct($config)
24
    {
25
        $this->loadConfig($config);
26
27
        if (empty($this->id)) {
28
            $this->id = 'grid_' . uniqid();
29
        }
30
    }
31
32
    /**
33
     * @return array
34
     */
35
    protected function configTests(): array
36
    {
37
        return [
38
            'id' => 'string',
39
        ];
40
    }
41
42
    public abstract function render(GridView $view) : string;
43
}