Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
AbstractTemplate
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getTemplate
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setTemplate
n/a
0 / 0
n/a
0 / 0
0
 render
n/a
0 / 0
n/a
0 / 0
0
 renderTemplate
n/a
0 / 0
n/a
0 / 0
0
1<?php
2/**
3 * Pop PHP Framework (http://www.popphp.org/)
4 *
5 * @link       https://github.com/popphp/popphp-framework
6 * @author     Nick Sagona, III <dev@nolainteractive.com>
7 * @copyright  Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)
8 * @license    http://www.popphp.org/license     New BSD License
9 */
10
11/**
12 * @namespace
13 */
14namespace Pop\View\Template;
15
16/**
17 * View template abstract class
18 *
19 * @category   Pop
20 * @package    Pop\View
21 * @author     Nick Sagona, III <dev@nolainteractive.com>
22 * @copyright  Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)
23 * @license    http://www.popphp.org/license     New BSD License
24 * @version    3.3.0
25 */
26abstract class AbstractTemplate implements TemplateInterface
27{
28
29    /**
30     * View template
31     * @var string
32     */
33    protected $template = null;
34
35    /**
36     * View data
37     * @var array
38     */
39    protected $data = [];
40
41    /**
42     * View output string
43     * @var string
44     */
45    protected $output = null;
46
47    /**
48     * Get view template
49     *
50     * @return string
51     */
52    public function getTemplate()
53    {
54        return $this->template;
55    }
56
57    /**
58     * Set view template
59     *
60     * @param  string $template
61     * @return AbstractTemplate
62     */
63    abstract public function setTemplate($template);
64
65    /**
66     * Render the view and return the output
67     *
68     * @param  array $data
69     * @throws Exception
70     * @return string
71     */
72    abstract public function render(array $data);
73
74    /**
75     * Render view template file
76     *
77     * @return void
78     */
79    abstract protected function renderTemplate();
80
81}