New feature - parentMethod
This commit is contained in:
parent
bbfa1fb48e
commit
20432dbf43
|
@ -147,6 +147,7 @@ class Page extends fileContent
|
||||||
return '/'.$htmlPath.'/'.$tmp;
|
return '/'.$htmlPath.'/'.$tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns the parent key, if the page doesn't have a parent returns FALSE.
|
||||||
public function parentKey()
|
public function parentKey()
|
||||||
{
|
{
|
||||||
$explode = explode('/', $this->getField('key'));
|
$explode = explode('/', $this->getField('key'));
|
||||||
|
@ -157,6 +158,18 @@ class Page extends fileContent
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns the parent method output, if the page doesn't have a parent returns FALSE.
|
||||||
|
public function parentMethod($method)
|
||||||
|
{
|
||||||
|
global $pages;
|
||||||
|
|
||||||
|
if( isset($pages[$this->parentKey()]) ) {
|
||||||
|
return $pages[$this->parentKey()]->{$method}();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function children()
|
public function children()
|
||||||
{
|
{
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
|
|
Loading…
Reference in New Issue