mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-04 14:50:59 +01:00
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:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user