Added $grav->getVersion() or grav.version in twig to get the current Grav version [#3142]

This commit is contained in:
Matias Griese
2021-02-08 13:47:23 +02:00
parent 8ea4216672
commit c7dcb9144c
2 changed files with 14 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
* Improved session fixation handling in PHP 7.4+ (cannot fix it in PHP 7.3 due to PHP bug)
* Added optional password/database attributes for redis in `system.yaml`
* Added ability to filter enabled or disabled with bin/gpm index [#3187](https://github.com/getgrav/grav/pull/3187)
* Added `$grav->getVersion()` or `grav.version` in twig to get the current Grav version [#3142](https://github.com/getgrav/grav/issues/3142)
1. [](#bugfix)
* Fixed CLI progressbar in `backup` and `security` commands to use styled output [#3198](https://github.com/getgrav/grav/issues/3198)
* Fixed page save failing because of uploaded images [#3191](https://github.com/getgrav/grav/issues/3191)

View File

@@ -162,6 +162,19 @@ class Grav extends Container
return self::$instance;
}
/**
* Get Grav version.
*
* @return string
*/
public function getVersion(): string
{
return GRAV_VERSION;
}
/**
* @return bool
*/
public function isSetup(): bool
{
return isset($this->initialized['setup']);