Lightweight, fast and easy to use theme made with HTML5 and PHP. No Frameworks used.
- PHP
Copy the folder src/semmelsamu/giga
to a static location on your webserver.
Include the index.php
file and create an instance of the Giga
class.
include("giga/index.php");
$giga = new Giga();
With this theme, it is also very simple to work with templates. Learn more here
To set what the theme should display, use $giga->your_setting = your_value
. Available settings are:
- Type:
bool
- Default:
false
- Specifies is the theme should be shown or not.
- Type:
string
- Default:
giga/
- Relative path from the uri to where the giga document root is. Needed for correctly linking the css and js files.
- Type:
string
- Default:
null
- HTML lang tag value.
- Type:
html
- Default:
null
- Additional content which belongs in the head.
- Type:
string
- Default:
null
- The title of the page.
- Type:
string
- Default:
null
- The title of the website.
- Type:
int
- Default:
0
- Specifies the width of the website:
0
: Whole screen1
: Part of the screen but still with aside content2
: Part of the screen without aside content
- Type:
bool
- Default:
false
- Specifies if the nav and header content should fade in.
- Type:
bool
- Default:
false
- Specifies if the nav should be displayed or not.
- Type:
string
- Default:
null
- The content in the left corner of the nav.
- Type:
string
- Default:
null
- The content in the right corner of the nav.
- Type:
bool
- Default:
false
- Specifies if the height of the nav is 64px or 96px.
- Type:
bool
- Default:
false
- Specifies if the nav widens when there is a header and the scroll position is on the top.
- Type:
bool
- Default:
false
- Specifies if the nav always is black.
- Type:
bool
- Default:
false
- Specifies if the header should be displayed or not.
- Type:
int
- Default:
0
- Specifies the height of the header:
- 0: Whole screen
- 1: Half the screen
- 2: Only as much as the content needs
- Type:
css
- Default:
url('../img/default.png')
- The
background-image
value of the header.
- Type:
html
- Default:
null
- The content of the header.
- Type:
bool
- Default:
false
- Specifies if the scroll-down-button on the bottom of the header should be displayed or not.
- Type:
bool
orhtml
- Default:
false
- If not false, the content will be displayed.
- Type:
bool
- Default:
false
- Specifies if the title of the page should be shown in the content heading.
- Type:
bool
orhtml
- Default:
false
- If not false, the aside content will be displayed.
- Type:
bool
- Default:
false
- Specifies if the aside content should stay next to the main content or not.
- Type:
bool
orhtml
- Default:
false
- If not false, the footer content will be displayed.
The following example shows a possible implementation of the theme:
<?php
include("../src/semmelsamu/giga/index.php");
$theme = new Giga();
// Using output buffering to get the HTML code:
ob_start();
?>
<h1>Hello World!</h1>
<p>This is a possible implementation of the theme.</p>
<?php
// The theme should be displayed:
$theme->show = true;
// Writing the buffer to the content:
$theme->content = ob_get_clean();
// Rendering the theme:
$theme->render();
?>
If you e.g. want to always have the same navigation and footer bar in every page, templates will do the job. One possible solution would be to work with a default file which you always include, and then to overwrite the content in the respective page:
default_content.php:
<?php
$theme->show = true;
$theme->main_title = "Giga Theme";
$theme->nav__left = "<li>Website Title</li>";
$theme->footer = "<p>Copyright MMXX...</p>";
?>
site.php:
<?php
include("../src/semmelsamu/giga/index.php");
$theme = new Giga();
include("default_content.php");
ob_start();
?>
<h1>Hello World!</h1>
<p>This is a possible implementation of templates.</p>
<?php
$theme->content = ob_get_clean();
$theme->render();
?>
As the theme provides more features than shown so far, other examples can be found in the examples
folder.