Completed
Push — master ( 84dbb5...744962 )
by Thierry
01:43
created

Template   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addViewNamespace() 0 4 1
A setPaginationDir() 0 4 1
1
<?php
2
3
/**
4
 * Template.php - Trait for template functions
5
 *
6
 * @package jaxon-core
7
 * @author Thierry Feuzeu <[email protected]>
8
 * @copyright 2016 Thierry Feuzeu <[email protected]>
9
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
10
 * @link https://github.com/jaxon-php/jaxon-core
11
 */
12
13
namespace Jaxon\Traits;
14
15
use Jaxon\DI\Container;
16
17
trait Template
18
{
19
    /**
20
     * Add a namespace to the template system
21
     *
22
     * @param string        $sNamespace         The namespace name
23
     * @param string        $sDirectory         The namespace directory
24
     * @param string        $sExtension         The extension to append to template names
25
     *
26
     * @return void
27
     */
28
    public function addViewNamespace($sNamespace, $sDirectory, $sExtension = '')
29
    {
30
        return Container::getInstance()->getTemplate()->addNamespace($sNamespace, $sDirectory, $sExtension);
31
    }
32
33
    /**
34
     * Set a new directory for pagination templates
35
     *
36
     * @param string        $sDirectory             The directory path
37
     *
38
     * @return void
39
     */
40
    public function setPaginationDir($sDirectory)
41
    {
42
        return Container::getInstance()->getTemplate()->setPaginationDir($sDirectory);
43
    }
44
}
45