Gc\View\Model::getContent PHP Метод

getContent() публичный Метод

Return file contents
public getContent ( ) : string
Результат string
    public function getContent()
    {
        if (file_exists($this->getFilePath())) {
            return file_get_contents($this->getFilePath());
        } else {
            return '';
        }
    }

Usage Example

Пример #1
0
 /**
  * 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;
 }
All Usage Examples Of Gc\View\Model::getContent