-
Notifications
You must be signed in to change notification settings - Fork 185
Expand file tree
/
Copy pathProfile.php
More file actions
34 lines (27 loc) · 790 Bytes
/
Profile.php
File metadata and controls
34 lines (27 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace Templates;
use League\Plates\Template\Template;
use League\Plates\Template\TemplateClassInterface;
class Profile implements TemplateClassInterface
{
public function display(Template $t, callable $f, callable $e, string $name): void { ?>
<?php $t->layout(new Layout('User Profile')) ?>
<?php // $this->layout('layout', ['title' => 'User Profile']) // this is working too and will get the example/templates/layout.php ?>
<h1>User Profile</h1>
<p>Hello, <?=$e($name)?>!</p>
<?php //$t->insert(new Sidebar()) ?>
<?= $f(new Sidebar()) ?>
<?php $t->push('scripts') ?>
<script>
// Some JavaScript
</script>
<?php $t->end() ?>
<?php
}
/**
* Autogenerated constructor.
*/
public function __construct(public string $name)
{
}
}