Add static helper methods to be used by the new page blueprints, and store the information in the session when creating a new page

This commit is contained in:
Flavio Copes
2015-10-01 15:33:33 +02:00
parent 4fac3d951c
commit d2daa17352
2 changed files with 25 additions and 0 deletions

View File

@@ -684,6 +684,26 @@ class Admin
return $parent_route;
}
/**
* Static helper method to return the last used page name
*
* @return string
*/
public static function getLastPageName()
{
return Grav::instance()['session']->lastPageName ?: 'default';
}
/**
* Static helper method to return the last used page route
*
* @return string
*/
public static function getLastPageRoute()
{
return Grav::instance()['session']->lastPageRoute ?: self::route();
}
/**
* Determine if the plugin or theme info passed is from Team Grav
*