PHP Classes

File: example/index.php

Recommend this page to a friend!
  Classes of Jeremiah Ogbomo   Push   example/index.php   Download  
File: example/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Push
Rapid Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 602 bytes
 

Contents

Class file image Download
<?php

include_once __DIR__.'/vendor/autoload.php';

$app = new Push\Application();

// $app->uses(new \Push\Middlewares\Session);
// $app->uses(new \Push\Middlewares\Flash);
// $app->uses(new \Push\Middlewares\Database);

// Hello world from Hello controller
$app->router->any('/hello/:$input', 'Hello@index');

// Hello world from Callback
$app->router->get('/:$input', function($req, $res){
 
$content = '<h1>Hello, '.$req['input'].'!</h1>';
 
$content .= '<h2>from Route callback..</h2>';
 
$content .= '<a href="hello/world">Goto Hello Controller</a>';

 
$res->write($content);
});

$app->run();