26 lines
394 B
PHP
26 lines
394 B
PHP
|
<?php
|
||
|
namespace App\Auth;
|
||
|
|
||
|
use Framework\Auth;
|
||
|
|
||
|
class AuthTwigExtension extends \Twig_Extension
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @var Auth
|
||
|
*/
|
||
|
private $auth;
|
||
|
|
||
|
public function __construct(Auth $auth)
|
||
|
{
|
||
|
$this->auth = $auth;
|
||
|
}
|
||
|
|
||
|
public function getFunctions()
|
||
|
{
|
||
|
return [
|
||
|
new \Twig_SimpleFunction('current_user', [$this->auth, 'getUser'])
|
||
|
];
|
||
|
}
|
||
|
}
|