added accessor for routeAliases

This commit is contained in:
Andy Miller
2015-06-29 15:30:32 -06:00
parent 7b4f0a29ac
commit 0a42ace4ba

View File

@@ -1136,7 +1136,8 @@ class Page
}
/**
* Gets the route for the page based on the parents route and the current Page's slug.
* Gets the route for the page based on the route headers if available, else from
* the parents route and the current Page's slug.
*
* @param string $var Set new default route.
*
@@ -1163,6 +1164,26 @@ class Page
return $this->route;
}
/**
* Gets the route aliases for the page based on page headers.
*
* @param array $var list of route aliases
*
* @return array The route aliases for the Page.
*/
public function routeAliases($var = null)
{
if ($var != null) {
$this->routes['aliases'] = (array) $var;
}
if (!empty($this->routes) && isset($this->routes['aliases'])) {
return $this->routes['aliases'];
} else {
return [];
}
}
/**
* Gets and sets the identifier for this Page object.
*