PHP Classes
elePHPant
Icontem

File: example/app/site/index.php

Recommend this page to a friend!
  Classes of Rafael Rodriguez  >  Div PHP Ways  >  example/app/site/index.php  >  Download  
File: example/app/site/index.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Div PHP Ways
Route HTTP requests to registered handlers
Author: By
Last change:
Date: 1 year ago
Size: 650 bytes
 

Contents

Class file image Download
<?php

#id = site
#listen = *
#listen = /...
#listen = /

// register controllers
divWays::register('site/Control/Prepare.php');
divWays::register('site/Control/Home.php');
divWays::register('site/Control/News.php');

// register controller with custom properties
divWays::register('site/Control/Blog.php', [
   
'id' => 'blog',
   
'listen' => [
       
'/blog',
       
'/blog/...'
   
],
   
'method' => 'Latest'
]);

// route to blog entry
divWays::listen('/blog/{id}', 'blog@Entry');

// route to blog comments
divWays::listen('/blog/{id}/comments', 'blog@Comments');

// custom ways
divWays::listen("/about", "home@About");

// bootstrap
$data = divWays::bootstrap();