Core Concepts

All static

All controller functions are static, you do not need any instantiation at any time. So you can access your controllers across each other easily.

// in view App/index.php
<html> ...
    <div>
    <?php Manual::sideMenu() ?>
    </div>
</html>

other example:

// in App controller
public static function index(){
    Manual::index();
}

Naming conventions

For any who has ever worked with an MVC framework that should be nothing new: the link between controller and view is done by correctly naming the folders and files to the controller and the calling function.

// Manual controller
public static function coreconcepts(){
    // tries to render the view at 
    // views/Manual/coreconcepts.php
    self::render();
}

DEVELOPEMENT mode and Exceptions

If you look in the config file (lib/config/conf.php) you will find a DEVELOPEMENT entry, set to true. This is our dev-mode.

With active developement-mode you have a small blue and ugly box in the lower right corner. Hover over it and it appears a menu with small helpers. For now you can create a new Controller with all the view-folders and files.

Also with active developement mode, the few Exceptions the framework will throw, are becomimg a bit more usefull. Perhaps if a render() call does not find the corresponding view, the Exception is asking if the view should be created.


PLAIN_PHP namespace

To not collide with any prefered Controller names, i put all the framework classes under the PLAIN_PHP namespace. If you want to create a new Controller, keep in mind to use the correct namespace!

class MyController extends PLAIN_PHP\Controller { ... }

//or equivalent    
use PLAIN_PHP\Controller;
class MyController extends Controller { ... }

The public folder

The public folder contains all non-php files that should be accassable from the outside. JavaScript, CSS or image-files. All other folders are protected with a .htaccess file.


Plain PHP

The framework consists of pure PHP code, nothing magical like the popular PHP annotations or something else is used, but only the native PHP language constructs. You extract the repository to your webserver and you are good to go!