-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·22 lines (19 loc) · 711 Bytes
/
index.php
File metadata and controls
executable file
·22 lines (19 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php namespace x\alert;
function y__alert($y) {
foreach ($y[1] as &$v) {
$v[0] = 'p';
$v[2]['role'] = 'alert';
// This key will be ignored by the `HTML` class but it can be used by other hook(s) as a reference
$v['type'] = $v[2]['type'];
unset($v[2]['type']);
}
unset($v);
return $y;
}
\Hook::set('y.alert', __NAMESPACE__ . "\\y__alert", 2);
// Set default alert layout if `.\lot\y\*\alert.php` file does not exist
if (\class_exists("\\Layout") && !\Layout::of('alert')) {
\Layout::set('alert', static function (string $key, array $lot = []) {
return new \HTML(\Hook::fire('y.' . $key, [[false, \Alert::get(), []], $lot]), true);
});
}