mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Add $this->request to module and template instances
This commit is contained in:
parent
a196706d7f
commit
96330593fd
2 changed files with 7 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue