ConfigView.php
840 Bytes
<?php
class ConfigView{
private $nome;
public function __construct($nome, array $dados = null){
$this->nome = (string) $nome;
$this->dados = $dados;
//var_dump($this->dados);
}
public function renderizar(){
include_once('views/includes/header.php');
include_once('views/includes/menu.php');
include_once('views/includes/footer.php');
if (file_exists("views/{$this->nome}.php")){
include_once("views/{$this->nome}.php");
}else{
echo "Erro ao carregar a view: {$this->nome}";
}
}
public function renderizarAuth()
{
if (file_exists('views/' . $this->nome . '.php')){
include 'views/' . $this->nome . '.php';
}
}
public function getDados(){
return $this->dados;
}
}