rendered paste body<?php
class Theme {
private $tags;
private $file;
/* Theme(void)
* - Constructor de la clase Theme. */
public function __construct() {
$this->tags = array();
$this->file = '';
}
/* Assign(string tag, string value)
* - Asigna valor a una etiqueta. */
public function Tag($tag, $value) {
$this->tags[$tag] = $value;
}
/* Replace(void)
* - Remplaza las etiquetas por su respectivo valor. */
public function Replace() {
foreach($this->tags as $tag => $value) {
$this->file = preg_replace('/%(' . $tag . ')%/', $value, $this->file);
}
}
/* Get(string path)
* - Remplaza las etiquetas por su respectivo valor. */
public function Get($path) {
if(is_readable($path) && is_file($path)) {
$this->file .= file_get_contents($path);
return true;
}
return false;
}
/* Clear(void)
* - Vacía las propiedades de la clase. */
public function Clear() {
$this->tags = array();
$this->file = '';
}
/* Display(void)
* - Vacía las propiedades de la clase. */
public function Display() {
echo $this->file;
}
}
?>