Skip to content

palpaga/Panzer-PHP-Framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Panzer PHP Framework

Minimal PHP Framework based on MVC

Implementation

  • Autoloading with PSR-4
  • Use Smarty as template engine
  • Use PHP>=7

Installation

For apache, in vhost configuration set the folder "public" as base path.

DocumentRoot /var/www/public
$ composer install

Create the folders "_compiled" and "_cache" in App/Views and set the wrinting permission.

edit the file app.json in App folder to setting the routes, database credentials, debug level and more.

Using

Routes

Panzer Framework using AltoRouter

Plugins

Controller

Exemple

namespace App\Controllers;

use Panzer\Controller;

class Exemple extends Controller
{
	public function index()
	{
		$this->view->assign(['data'=>$this->model->getTable()])
		->render('exemple');
	}
}

Model

Exemple

namespace App\Models;

use Panzer\Database;

class Exemple extends Database
{
	public function getTable()
	{
		return self::$db->query("SELECT * FROM ".self::addPrefix('table'))->fetchAll(\PDO::FETCH_ASSOC);
	}
}

View

Panzer Framework using Smarty

About

Minimal PHP Framework based on MVC pattern

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published