-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
55 lines (44 loc) · 1.39 KB
/
index.php
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
require_once dirname(__FILE__, 3) . '/vendor/autoload.php';
use Knp\Menu\MenuFactory;
use Knp\Menu\Renderer\ListRenderer;
$html = <<< HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>KNP-Meun | PHP Awesome</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
</head>
HTML;
echo $html;
$factory = new MenuFactory();
$menu = $factory->createItem('My menu');
$menu->setAttribute('class', 'col-md-8 list-group');
$menu->addChild(
'GitHubMenu',
[
'uri' => 'https://github.com/mahmoudmohamedramadan',
'label' => 'Github',
'attributes' => ['class' => 'list-group-item']
]
);
$menu->addChild('LinkedIn', [
'uri' => 'https://www.linkedin.com/in/mahmoudmohamedramadan/',
'attributes' => ['class' => 'list-group-item']
]);
$menu->addChild(
'Instagram',
[
'uri' => 'https://www.instagram.com/mahmoudmohamedramadan496/',
'attributes' => ['class' => 'list-group-item']
]
);
// This line allows you to rename menu which has name `Home`
$menu["GitHubMenu"]->setLabel("GitHub");
$renderer = new ListRenderer(new \Knp\Menu\Matcher\Matcher());
echo '<main class="col-md-5 mt-5">';
echo $renderer->render($menu);
echo '</main>';