mirror of
https://github.com/getgrav/grav.git
synced 2026-03-21 20:11:35 +01:00
added accessor for routeAliases
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user