Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Snaju Open Source Software
inception
Commits
179386cd
Commit
179386cd
authored
3 years ago
by
Othneil Drew
Browse files
Options
Download
Email Patches
Plain Diff
Update twig user file
parent
bee44562
master
cell
v1.1.0
v1.0.17
v1.0.16
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Inception/Route/Loaders/Twig/Extensions/CustomFunctions.php
+12
-1
Inception/Route/Loaders/Twig/Extensions/CustomFunctions.php
with
12 additions
and
1 deletion
+12
-1
Inception/Route/Loaders/Twig/Extensions/CustomFunctions.php
View file @
179386cd
...
...
@@ -2,6 +2,7 @@
namespace
Snaju\Inception\Route\Loaders\Twig\Extensions
;
use
App\Models\User
;
use
Snaju\Inception\Http\Message\FlashMessage
;
use
Snaju\Inception\InceptionCore
;
use
Twig\Extension\AbstractExtension
;
...
...
@@ -20,6 +21,7 @@ class CustomFunctions extends AbstractExtension {
new
TwigFunction
(
'getFlashMessage'
,
[
$this
,
'getFlashMessage'
]),
new
TwigFunction
(
'getFlashMessages'
,
[
$this
,
'getFlashMessages'
]),
new
TwigFunction
(
'getFullYear'
,
[
$this
,
'getFullYear'
]),
new
TwigFunction
(
'getUser'
,
[
$this
,
'getUser'
]),
);
}
...
...
@@ -32,7 +34,7 @@ class CustomFunctions extends AbstractExtension {
{
return
Config
::
get
(
'app.publicDirectory'
);
}
public
function
getConfigValue
(
string
$key
)
{
return
Config
::
get
(
$key
);
...
...
@@ -58,4 +60,13 @@ class CustomFunctions extends AbstractExtension {
return
date
(
'Y'
);
}
public
function
getUser
()
{
if
(
User
::
hasAuthenticatedUser
())
{
return
User
::
getCurrentUser
();
}
return
null
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help