Gc\Layout\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\Layout\Model
  */
 public static function fromArray(array $array)
 {
     $layoutTable = new Model();
     $layoutTable->setData($array);
     $layoutTable->setOrigData();
     if (empty($array['content'])) {
         $layoutTable->setContent($layoutTable->getContent());
     }
     return $layoutTable;
 }