Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/netfloex/simple-php-site
Simple php site with routing and layout support
https://github.com/netfloex/simple-php-site
layout less lesscss php routing
Last synced: 7 days ago
JSON representation
Simple php site with routing and layout support
- Host: GitHub
- URL: https://github.com/netfloex/simple-php-site
- Owner: Netfloex
- Created: 2020-10-23T15:55:43.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-24T11:59:22.000Z (over 4 years ago)
- Last Synced: 2025-01-19T16:09:58.698Z (7 days ago)
- Topics: layout, less, lesscss, php, routing
- Language: PHP
- Homepage: https://php.samtaen.nl
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple PHP Site
## Features
* Layout - [Configurable here](views/layout.php)
* [Less](https://lesscss.org) - [Configurable here](less/index.less)
* Custom directory names - [Configurable here](config/paths.json)
* Very basic routing - [Configurable here](config/pages.json)## 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.confServerName *host*
DocumentRoot "/var/www/*dirname*/public"# To allow rewriting to the router
AllowOverride All
allow from all
Options +Indexes```
## 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](views/layout.php).
* The landing page is easily editable in [views/index.php](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](less/index.less).
* To use multiple stylesheets you can import them in your [less/index.less](less/index.less) by using `@import 'file'`.
* To add or change existing routes you can edit the JSON config in [config/pages.json](config/pages.json).
## Routes
```js
// 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"
}
}
```