Example #1
0
<?php

// Benchmarking
$benchmark = microtime(true);
// Path defines
define('ROOTPATH', realpath(__DIR__) . '/');
define('APPPATH', realpath(__DIR__ . '/application') . '/');
define('SYSPATH', realpath(__DIR__ . '/modules') . '/');
define('SKINPATH', realpath(__DIR__ . '/skins/default') . '/');
// Require ToyPHP framework
require SYSPATH . 'toy/toy.php';
// Define application
$app = toy::module('app');
// Anonymous function as WelcomeController
$app->controller('WelcomeController', function () {
    // include HTML file
    require APPPATH . 'views/welcome.html.php';
});
// Run WelcomeController
$app->WelcomeController->run();
// Debug
print '<script>$(function(){$("body").append("<p style=\\"text-align: center; margin: 15px 0;\\">Page rendered in ' . number_format(microtime(true) - $benchmark, 4) . '(sec.)</p>")});</script>';
/* End of file index.php */
/* Location: ./index.php */
Example #2
0
 /**
  *
  * @return null|stdClass
  */
 public function asObject()
 {
     if (!isset($this->_stream[$this->name])) {
         return false;
     }
     return toy::module()->encoder()->decrypt($this->asString());
 }
Example #3
0
/**
 * Uri language
 */
function language()
{
    toy::module('toy')->uri->language();
}