public function getContent()
{
if (file_exists($this->getFilePath())) {
return file_get_contents($this->getFilePath());
} else {
return '';
}
}
/** * Initiliaze from array * * @param array $array Data * * @return \Gc\View\Model */ public static function fromArray(array $array) { $viewTable = new Model(); $viewTable->setData($array); $viewTable->setOrigData(); if (empty($array['content'])) { $viewTable->setContent($viewTable->getContent()); } return $viewTable; }