Skip to content

RundesBalli/lightweight-PHP-Boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”§ lightweight-PHP-Boilerplate

A lightweight PHP boilerplate and customizable code-foundation for building secure and dynamic websites with ease.


πŸ”© Preparation

First of all, clone or download the repository and rename the config file:

git clone https://github.com/RundesBalli/lightweight-PHP-Boilerplate.git
cd ./lightweight-PHP-Boilerplate
mv ./includes/config.template.php ./includes/config.php

Put your configuration variables and/or sql credentials into this file. Then fill in the fields in the includes/templates/template.tpl file. Replace the image files in public/assets/images with your own logo and header graphics.


πŸ‘€ Style

The HTML- and CSS-Template isn't styled at all. It's only the basic skeleton. You have to add your own style.


❓ How to use?

πŸ“œ Routes

To add some pages to your website, you have to extend the $routes in the includes/routing/routes.php.

$routes = array(
  'start'      => 'start.php',
  'foobar'     => 'foobar.php',
  '404'        => '404.php',
  '403'        => '403.php',
  'somePage'   => 'somePage.php'
);

If you want the page to be displayed in the navigation, you have to extend the $nav in includes/generation/navigation.php:

$nav.= '<a href="/abc"'.($route == 'abc' ? $a : NULL).'>ABC</a>';

πŸ“‹ Pages

To create a new page, you can simply copy the pages/start.php file. If you want to have a page title added to your template title, you have to set it with the $title variable.


πŸ˜„ That's it!


⌨️ Issues and suggestions

Feel free to open an issue 😊

About

πŸ”§ A lightweight PHP boilerplate and customizable code-foundation for building secure and dynamic websites with ease.

Topics

Resources

License

Stars

Watchers

Forks