Add $this->request to module and template instances

This commit is contained in:
Kijin Sung 2023-10-29 23:37:08 +09:00
parent a196706d7f
commit 96330593fd
2 changed files with 7 additions and 3 deletions

View file

@ -8,9 +8,10 @@ namespace Rhymix\Framework;
class Template
{
/**
* Properties for user
* Properties for convenience
*/
public $user;
public $request;
/**
* Properties for configuration
@ -81,8 +82,9 @@ class Template
// Initialize configuration.
$this->_initConfig();
// Set user information.
// Set user and current request information.
$this->user = Session::getMemberInfo() ?: new Helpers\SessionHelper();
$this->request = \Context::getCurrentRequest();
// Populate static properties for optimization.
if (self::$_mtime === null)
@ -107,7 +109,7 @@ class Template
/**
* Initialize the configuration object.
*
*
* @return void
*/
protected function _initConfig(): void