Skip to content

Netfloex/Simple-PHP-Site

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple PHP Site

Features

How To install

cd /var/www/
git clone https://github.com/Netfloex/Simple-PHP-Site.git *dirname*

If you use apache

nano /etc/apache2/sites-enabled/simple.conf

<VirtualHost *:80>
        ServerName *host*
        DocumentRoot "/var/www/*dirname*/public"
</VirtualHost>
# To allow rewriting to the router
<Directory /var/www/*dirname*/public>
  AllowOverride All
  allow from all
  Options +Indexes
</Directory>

Getting started

  • To change the layout of your site (basic html structure for every page) you can edit the file contents in views/layout.php.
  • The landing page is easily editable in views/index.php, this page will inherit from the layout.
  • To style your page, dont edit public/css/app.css, this file is automatically generated. Instead you can edit less/index.less.
  • To use multiple stylesheets you can import them in your less/index.less by using @import 'file'.
  • To add or change existing routes you can edit the JSON config in config/pages.json.

Routes

// config/pages.json
{
    "/": { // Landing page
        "title": "Main", // The title of the page
        "doc": "index" // views/index.php
    },
    "mypage": { // Add your own! 
        "title": "Jo gamer" // If you dont specify the document property it automatically looks for "views/mypage.php"
    },
    "notFound": { // This page is used for a 404 error
        "title": "404, not found",
        "doc": "404"
    }
}

About

Simple php site with routing and layout support

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages