Learning - Fat-Free PHP Framework (Template Hierarchy)
Template Hierarchy
Copy from bootstrap
-
Go to https://getbootstrap.com/getting-started/#examples, select Dashboard.
-
Copy
dashboard.htm
toapp/views/dashboard.htm
-
Copy
dashboard.css
intoapp/css/dashboard.css
-
Create
app/views/header.htm
- Move html header in
dashboard.htm
intoheader.htm
- Delete unecessary javascript for IE8
- Update
bootstrap.min.css
to CBN version - Update the path of
dashboard.css
- Move html header in
-
Create
app/views/layout.htm
<include href="header.htm" />
<include href="{{ @view }}" />
- Update
MainController
class
<?php
class MainController extends Controller {
function render() {
$this->f3->set('view', 'dashoboard.htm');
$template = new Template;
echo $template->render('layout.htm');
}
}
- Create
nav.htm
Move the body contents before Dashboard div into file nav.htm
<body>
...
...
<ui class="nav nav-sidebar">
...
</ui>
</div>