PHP Classes

File: test/subfolder/index.php

Recommend this page to a friend!
  Classes of Nikos M.   Tico PHP MVC Framework   test/subfolder/index.php   Download  
File: test/subfolder/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Tico PHP MVC Framework
Framework to implement MVC applications in PHP
Author: By
Last change:
Date: 1 month ago
Size: 767 bytes
 

Contents

Class file image Download
<?php

define
('ROOT', dirname(__FILE__));
include(
ROOT . '/../../tico/Tico.php');

tico(/*'https://my.git/tico/test/subfolder'*/ 'http://localhost:8000/subfolder', ROOT)
->
option('webroot', ROOT)
->
option('case_insensitive_uris', true)
->
option('views', [tico()->path('/views')])
->
on('*', '/', function() {

   
tico()->output(
        array(
           
'title' => 'Index',
           
'msg' => 'index',
        ),
       
'hello.tpl.php'
   
);

})
->
on('*', '/foo', function() {

   
tico()->output(
        array(
           
'title' => 'foo',
           
'msg' => 'foo',
        ),
       
'hello.tpl.php'
   
);

})
->
on(false, function() {

   
tico()->output(
        array(),
       
'404.tpl.php',
        array(
'StatusCode' => 404)
    );

})
->
serve()
;