File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- *
3
+ * Available Tokens:
4
+ * {expression} includes parentheses, e.g ('user')
5
+ * {expr} without parentheses, e.g 'user'
6
+ * {var} variable name, e.g user
4
7
*/
5
8
6
9
use View5 \Template ;
10
+ use View5 \Token \Expression as Expr ;
7
11
8
12
return [
9
13
'auth ' => '<?php ${var} = $this->plugin({expr}); if (${var}->authenticated()) : ?> ' ,
10
14
'endAuth ' => '<?php endif; ?> ' ,
11
- /*'endAuth' => function(string $expression, Template $template) : string {
12
- return '<?php endif; ?>';
15
+ /*'auth' => function(string $expression, Template $template) : string {
16
+ $var = Expr::var($expression); $plugin = Expr::expr($expression);
17
+ return '<?php $' . $var . ' = $this->plugin(' . $plugin . '); if ($' . $var . '->authenticated()) : ?>';
13
18
},*/
14
19
];
You can’t perform that action at this time.
0 commit comments