mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
An example from Sebastian Bergmann of how we can inject dependancies
This commit is contained in:
parent
24de1dff3b
commit
3c096b3466
@ -95,7 +95,7 @@ class infolog_ui
|
||||
*
|
||||
* @return infolog_ui
|
||||
*/
|
||||
function __construct()
|
||||
function __construct(Etemplate $etemplate = null)
|
||||
{
|
||||
if ($GLOBALS['egw_info']['flags']['currentapp'] != 'infolog') Api\Translation::add_app('infolog');
|
||||
|
||||
@ -107,7 +107,11 @@ class infolog_ui
|
||||
|
||||
$this->bo = new infolog_bo();
|
||||
|
||||
$this->tmpl = new Etemplate();
|
||||
if($etemplate === null)
|
||||
{
|
||||
$etemplate = new Etemplate();
|
||||
}
|
||||
$this->tmpl = $etemplate;
|
||||
|
||||
$this->user = $GLOBALS['egw_info']['user']['account_id'];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user