PHP Classes

How to Use a PHP Website Framework to Generate the Output of the Pages of a Site Using the Package Very Simple Site Framework: Framework to handle Web site requests

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2026-02-03 (4 months ago) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
very-simple-site-fra 1.0MIT/X Consortium ...7Libraries, Design Patterns, PHP 7
Description 

Author

This package provides a framework to handle Website requests.

It provides a router class that can take a variable name and checks the request variables to determine which controller and view classes that will handle the request.

The router class will call the controller class, passing the name of the view that will be used to generate the output of the pages.

The package provides base controller class, user login and logout classes, and example controller class.

Picture of Ákos Nikházy
  Performance   Level  
Name: Ákos Nikházy <contact>
Classes: 18 packages by
Country: Hungary Hungary
Innovation award
Innovation award
Nominee: 8x

Instructions

Please read this document to learn how to setup and Web site using this framework.

Example

<?php
/***********************
    Nikházy Ákos

index.php

Loads head with that all settings and decides what to show
to the user based on the presence and value of $_GET['view']
and the login status
***********************/

require_once __DIR__ . '/require/head.php';

$user = new User();

$view = $_GET['view'] ?? 'main';

// if user not logged in the login page is the only place they can go
if(!$user -> getLoginStatus()) $view = 'login';

$router = new Router($view);
$router->route();



Details

very-simple-site-framework

Just a very simple almost static website framework I use for small projects to build them very fast.

It is static, because you have to hard code pages in the Router class and create Controller classes with the same name you described in the Router class.

Setup

The username and password are admin and admin. You can generate a new one by using the following code anywhere in MainController.php's handle() method. Or in index.php or wherever you find it good to print this out.

  $pw = new Password(APPKEY); // you should change the APPKEY value for even more safety in the require/head.php ?
  echo '<pre>';
  var_dum($pw ->createPasswordHash('YOUR PRECIOUS SECRET PASSWORD'));
  die();

Then you should edit the auth.yzhk file with the data you just printed to look like this:


Or even better: create a better login scheme for it. I run small apps with this on my local server, so this is fine, but on more public spaces you should consider secuirty much more than this.

# Loginless
If you want it without login (eg.: a simple website) just go to the index.php and get rid of the ```if(!$user -> getLoginStatus()) $view = 'login';```. Then the program routes the visitor to main. Also then you do not need the ```$user = new User();``` line either.

  Files folder image Files (25)  
File Role Description
Files folder imageclasses (5 files)
Files folder imagecontroller (4 files)
Files folder imagecss (3 files, 1 directory)
Files folder imagerequire (1 file)
Files folder imagetemplate (1 file, 1 directory)
Files folder imagetext (2 files)
Accessible without login Plain text file auth.yzhk Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (25)  /  classes  
File Role Description
  Plain text file Password.class.php Class Class source
  Plain text file Router.class.php Class Class source
  Plain text file Template.class.php Class Class source
  Plain text file Text.class.php Class Class source
  Plain text file User.class.php Class Class source

  Files folder image Files (25)  /  controller  
File Role Description
  Plain text file BaseController.php Class Class source
  Plain text file LoginController.php Class Class source
  Plain text file LogoutController.php Class Class source
  Plain text file MainController.php Class Class source

  Files folder image Files (25)  /  css  
File Role Description
Files folder imageimg (1 file)
  Accessible without login Plain text file c.php Aux. Auxiliary script
  Accessible without login Plain text file index.php Aux. Configuration script
  Accessible without login Plain text file main.css Data Auxiliary data

  Files folder image Files (25)  /  css  /  img  
File Role Description
  Accessible without login Image file icon.png Icon Icon image

  Files folder image Files (25)  /  require  
File Role Description
  Accessible without login Plain text file head.php Conf. Configuration script

  Files folder image Files (25)  /  template  
File Role Description
Files folder imagehtml (4 files)
  Accessible without login HTML file index.html Doc. Documentation

  Files folder image Files (25)  /  template  /  html  
File Role Description
  Accessible without login HTML file error-box.html Doc. Documentation
  Accessible without login HTML file index.html Doc. Documentation
  Accessible without login HTML file login.html Doc. Documentation
  Accessible without login HTML file main.html Doc. Documentation

  Files folder image Files (25)  /  text  
File Role Description
  Accessible without login Plain text file index.json Data Auxiliary data
  Accessible without login Plain text file login.json Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads  
 100%
Total:0
This week:0