Completed
Pull Request — 2.0.x (#6)
by Andrew
02:53
created

AbstractPageContentView   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A var_page() 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\AbstractViewModel;
12
use Ingenerator\KohanaView\ViewModel\PageContentView;
13
use Ingenerator\KohanaView\ViewModel\PageLayoutView;
14
15
/**
16
 * Provides a base class for all views that are intended to be the main view on a page, to
17
 * allow the use of the PageLayoutRenderer to dynamically wrap the rendered output in a separate
18
 * PageLayoutView when appropriate.
19
 *
20
 * This also allows the page content view to have access to the containing page - for example
21
 * to set the title or otherwise interact with the <head> and <meta> parts of the page.
22
 *
23
 * @property-read PageLayoutView $page
24
 *
25
 * @package Ingenerator\KohanaView\ViewModel\PageLayout
26
 */
27
abstract class AbstractPageContentView extends AbstractViewModel implements PageContentView
28
{
29
30
    /**
31
     * @var PageLayoutView
32
     */
33
    protected $page_view;
34
35
    public function __construct(PageLayoutView $page)
36
    {
37
        $this->page_view = $page;
38
        parent::__construct();
39
    }
40
41
    /**
42
     * @return PageLayoutView
43
     */
44
    public function var_page()
45
    {
46
        return $this->page_view;
47
    }
48
49
}
50