getPageParent() public method

Returns the parent name of the specified page.
public getPageParent ( Cms\Classes\Page $page )
$page Cms\Classes\Page Specifies a page object.
コード例 #1
0
ファイル: Page.php プロジェクト: xNok/pages-plugin
 /**
  * Returns the parent page that belongs to this one, or null.
  * @return mixed
  */
 public function getParent()
 {
     if ($this->parentCache !== null) {
         return $this->parentCache;
     }
     $pageList = new PageList($this->theme);
     $parent = null;
     if ($fileName = $pageList->getPageParent($this)) {
         $parent = static::load($this->theme, $fileName);
     }
     return $this->parentCache = $parent;
 }