Completed
Push — 2.0.x ( f85be6...e30486 )
by Andrew
02:32
created

AbstractPageLayoutView   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 32
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setTitle() 0 4 1
A setBodyHTML() 0 4 1
1
<?php
2
/**
3
 * @author     Andrew Coulton <[email protected]>
4
 * @copyright  2015 inGenerator Ltd
5
 * @license    http://kohanaframework.org/license
6
 */
7
8
namespace Ingenerator\KohanaView\ViewModel\PageLayout;
9
10
11
use Ingenerator\KohanaView\ViewModel;
12
use Ingenerator\KohanaView\ViewModel\AbstractViewModel;
13
14
/**
15
 * Provides a base class for all views that are intended to provide a complete HTML template that will
16
 * contain some body html content - eg for the global site layout etc.
17
 *
18
 * It is commonly used together with a PageContentView but note you can always still create an instance
19
 * of this page layout and display any html string directly for simpler cases.
20
 *
21
 * @property-read string $body_html The content to display in the body HTML area
22
 * @property-read string $title     The page title
23
 *
24
 * @package Ingenerator\KohanaView\ViewModel\PageLayoutView
25
 */
26
abstract class AbstractPageLayoutView extends AbstractViewModel implements ViewModel\PageLayoutView
27
{
28
29
    /**
30
     * @var array
31
     */
32
    protected $variables = [
33
        'body_html' => NULL,
34
        'title'     => NULL,
35
    ];
36
37
    /**
38
     * @param string $title
39
     *
40
     * @return void
41
     */
42
    public function setTitle($title)
43
    {
44
        $this->variables['title'] = $title;
45
    }
46
47
    /**
48
     * @param string $html
49
     *
50
     * @return void
51
     */
52
    public function setBodyHTML($html)
53
    {
54
        $this->variables['body_html'] = $html;
55
    }
56
57
}
58