Gc\View\Model::getContent PHP Method

getContent() public method

Return file contents
public getContent ( ) : string
return string
    public function getContent()
    {
        if (file_exists($this->getFilePath())) {
            return file_get_contents($this->getFilePath());
        } else {
            return '';
        }
    }

Usage Example

コード例 #1
0
ファイル: Model.php プロジェクト: gotcms/gotcms
 /**
  * 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