| Total Complexity | 7 |
| Total Lines | 76 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class Template |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | private $_template = 'default'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private $_title = ''; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var array |
||
| 24 | */ |
||
| 25 | private $_properties = []; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Método para setear propiedades |
||
| 29 | * @param string $prop |
||
| 30 | * @param mixed $value |
||
| 31 | */ |
||
| 32 | public function set($prop, $value) |
||
| 35 | } |
||
| 36 | |||
| 37 | |||
| 38 | /** |
||
| 39 | * Método para obtener propiedades |
||
| 40 | * @param string $prop |
||
| 41 | * @return mixed|null |
||
| 42 | */ |
||
| 43 | public function get($prop) |
||
| 44 | { |
||
| 45 | return isset($this->_properties[$prop]) ? $this->_properties[$prop] : null; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Permite asignar el template manualmente |
||
| 50 | * @param string $template |
||
| 51 | */ |
||
| 52 | public function setTemplate($template) |
||
| 53 | { |
||
| 54 | $this->_template = $template; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Permite asignar el title manualmente |
||
| 59 | * @param string $title |
||
| 60 | */ |
||
| 61 | public function setTitle($title) |
||
| 62 | { |
||
| 63 | $this->_title = $title; |
||
| 64 | } |
||
| 65 | |||
| 66 | |||
| 67 | |||
| 68 | /** |
||
| 69 | * Permite renderizar una vista dentro de la plantilla |
||
| 70 | * @param string $view |
||
| 71 | */ |
||
| 72 | public function render($view) |
||
| 86 | } |
||
| 87 | } |
||
| 88 | } |
||
| 89 |