-
-
Notifications
You must be signed in to change notification settings - Fork 6
Headers and footers
For all pages of an application there is always going to be some shared HTML at the top and bottom of the page. It's beneficial to keep this code consistent between page views, and not to repeat the same HTML across multiple source pages. The parts of the Page View that are the same for all pages can be put into special files named _header.html
and _footer.html
, and will be automatically applied to all views in the same directory or deeper.
It is possible to override the header and/or footer for nested directories by placing another header/footer file in a lower directory, such as page/admin/_header.html
. In this example, all page requests to /admin
and deeper (such as /admin/settings
, /admin/users
) will have the new header applied, however it's always a good idea to keep the headers and footers as consistent as possible across all views of the application.
It is beneficial to have the same consistent header and footer throughout your application wherever possible, but certain pages may need the header/footer removing, so that they can specify their own.
This is done on a per-file basis by inserting an HTML comment as the first line of the file. There are three comments to use:
-
<!--no-header-->
- Disable loading the_header.html
file. -
<!--no-header-footer-->
- Disable loading both the_header.html
and_footer.html
files. -
<!--no-footer-->
- Disable loading the_footer.html
file.
Website | Packagist | CircleCI | Scrutinizer
- Request-response lifecycle
- Running your application
- Project layout
- Application architecture
- Web servers
- URIs
- Page view
- Dynamic URIs and pages
- Headers and footers
- Page logic
- Protected globals
- User input
- Cookies
- Sessions
- DOM manipulation
- Custom HTML components
- DOM templates
- Binding data to the DOM
- Database
- Client side assets
- API Webservices
- Security
- Configuration
- Build system
- Coding styleguide