Basic Template
Small PHP Template to create webpages.

About this Template

A very simple but effective Templating engine written in PHP. You can just add your own PHP File into the `pages` Folder and the engine will render the content depending on the requestet Page.

Read the Documentation for more infos about how to use this.

Why another PHP Framework/Tempate thing?
Because i want to build a small on of my own and all i found was very bloaten and use some template enging besed by replacing Texts like "{{TILTE}}" by a Title String. Here we use ordinary PHP Files for the Template and for the Page Files. This make the Handling easy, if you are familary by PHP. The Engine itself is also writen in PHP (basicly 2 Classes which build the Page whithin his Content).

You can also just place raw HTML into the Files, but be aware to keep the Prefix `.php` to them!

Files into the Folders `inc/css` and `inc/js` will be automaticly loaded into the Page Header.

A basic Navigation is in the default Templates. It will included from the `header.php` File. Feel Free to buld other Navigations

The base construct is very loose, which has advantages (you can easiely add own changes) and disadvantage (some Changes might be hard to implement).

Prometheus ready scrape endpoint. You can find your metrincs data under the following Link: https://www.mvattersen.de/basic/?page=metrics

Pages

All Pages can be found under the Path inc/pages/. There you can place new Page Files which will be automaticly available in the Menu, unlike you Exclude their Names in the config.php.

Pagelist

List of all Files under the inc/pages/ Folder:

  • 401.php
  • 403.php
  • 404.php
  • authtest.php
  • contact.php
  • documentation.php
  • environment.php
  • feed.php
  • galerie.php
  • imprint.php
  • index.php
  • info.php
  • login.php
  • news.php

Menu Pages

List of all Names which are visible in the main Menu:

  • Authtest
  • Contact
  • Documentation
  • Environment
  • Imprint
  • News

Excluded Pages

List of all Names which are in the MENU_EXCLUDE array under the config.php File (They wont be visible in the main Menu):

  • index -> index.php
  • 401 -> 401.php
  • 403 -> 403.php
  • 404 -> 404.php
  • login -> login.php
  • info -> info.php
  • feed -> feed.php
  • galerie -> galerie.php

PHP Classes

All Classes can be found under the Path inc/class/extensions/. There you can place new Classes which will be automaticly available in the Pages. Often we use here static functions to get easy access from the Pages itself.

They all will be automaticly instanciated from the Class: inc/class/Template.php. This is done by the Basic.php Class, which have an autoload function for this.

Base

Class inc/class/extensions/Base.php

Description from Classfile:
Class Base will be used as the Mainclass. It instanciates all other Classes by the PHP spl_autoload_register function

Functions of class Base:

  • appSize( )
  • totalFiles( )
  • getEnv( )
  • lastUpdated( )
  • getOpenDoings( )
  • getCookieString( )
  • login( user, passwd )

Crypto

Class inc/class/extensions/Crypto.php

Description from Classfile:
Class Crypto Contains the crypthographic functions

Functions of class Crypto:

  • genToken( length, form )
  • token( string )
  • genSRI( file )

DB_SQLite3

Class inc/class/extensions/DB_SQLite3.php

Description from Classfile:
Class DB_SQLite3 will be used to get access to a SQLite Database

Functions of class DB_SQLite3:

  • __construct( type, dbfile )
  • close( )
  • connection( )
  • getDb( )
  • query( query, fetchMode, fetchModeArgs )
  • bind( param, value, type )
  • execute( )
  • resultset( )
  • resultObj( )
  • single( )
  • rowCount( table )
  • debugDumpParams( )
  • queryString( )
  • errorInfo( )
  • beginTransaction( )
  • commit( )
  • errorCode( )
  • exec( statement )
  • getAttribute( attribute )
  • getAvailableDrivers( )
  • inTransaction( )
  • lastInsertId( name )
  • prepare( query, options )
  • quote( string, type )
  • rollBack( )
  • setAttribute( attribute, value )

DateAndTime

Class inc/class/extensions/DateAndTime.php

Description from Classfile:
Class DateAndTime Helper functions to parse Date and Time

Functions of class DateAndTime:

  • germanDay( day, format )
  • germanMonth( month, format )
  • expireDate( )
  • time2date( time )
  • date2time( date )
  • isTimestamp( string )

Email

Class inc/class/extensions/Email.php

Description from Classfile:
Class Email will be used to send Emails

Functions of class Email:

  • formular( )
  • checkPearMail( )

Exporter

Class inc/class/extensions/Exporter.php

Description from Classfile:
Class Exporter will be used to get an Prometheus Endpoint for Site Metrics

Functions of class Exporter:

  • appExporter( )

Feeds

Class inc/class/extensions/Feeds.php

Description from Classfile:
Class Feeds will be used to get an Endpoint for RSS/Atom Newsfeeds from the News Page of the Site. This is currently a Work in Progress and is not ready yet.

Functions of class Feeds:

  • generate( data )
  • innerNodes( inner_value, inner_key, doc, root )
  • ellipsesText( input, length, ellipses, strip_html )
  • createNode( doc, parent, name, content, attributes )
  • createDoc( data )

Git

Class inc/class/extensions/Git.php

Description from Classfile:
Class Git will be used to get some Infromations about the git Project Data

Functions of class Git:

  • gitLast( )
  • gitCurrent( )
  • gitRemote( )
  • gitCommits( )
  • checkForUpdate( )
  • gitTag( )
  • gitPHP( )

Gmap

Class inc/class/extensions/Gmap.php

Description from Classfile:
Class Gmap Generates a simple google map frame

Functions of class Gmap:

  • gmaps( address )

Markdown

Class inc/class/extensions/Markdown.php

Description from Classfile:
Class Markdown will be used to render Markdown Documents in HTML. This is inspired by the https://github.com/jbroadway/slimdown Project.

Functions of class Markdown:

  • getHeaders( )
  • render( text )

Visitor

Class inc/class/extensions/Visitor.php

Description from Classfile:
Class Visitor will be used to collect persistant Sitevisitor data

Functions of class Visitor:

  • requestCounter( )