Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.
/ hrphp-framework Public archive

A tutorial project for developers interested in learning more about PHP web development frameworks.

License

Notifications You must be signed in to change notification settings

hrphp/hrphp-framework

Repository files navigation

The HRPHP Framework

Build Status Code Coverage Scrutinizer Code Quality

A tutorial project for developers interested in learning more about PHP web development frameworks.

Overview

PHP web frameworks are ubiquitous. Using one can boost productivity. Writing one can teach you a lot about PHP, the web, and software engineering. The aim here is to build a micro-framework -- something lightweight with just enough functionality to allow a developer to build powerful applications.

Getting started

The proposed routing mechanism is inspired by Slim.

// instantiate the app
$app = new \Hrphp\Application();

// define a new route with a basic response
$app->get('/foo', function () use ($app) {
    $app->render('Hello, World!');
});

// define a new route that has a corresponding layout and partial
$app->get('/bar', function () use ($app) {
    $data = [ 'group' => 'hrphp' ];
    $app
        ->setLayout('master')
        ->setPartial('index/index')
        ->render($data);
});

About

A tutorial project for developers interested in learning more about PHP web development frameworks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages