function run($uri, $method) { $url_prefix = \Framework\Application::$url_prefix; if (substr($uri, 0, strlen($url_prefix)) == $url_prefix) { $uri = substr($uri, strlen($url_prefix)); } $path = strtok($uri, '?'); if ($path[0] != '/') { $path = '/' . $path; } parent::route($method, $path); }
<?php include __DIR__ . "/../core/init.php"; include __DIR__ . "/../lib/index.php"; $application = new Application(); $application->route();
<?php define('DACCESS', 1); require 'framework.php'; $app = new Application(); $app->route(); $app->dispatch(); $app->render();
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); require_once __DIR__ . "/vendor/autoload.php"; $config = (require __DIR__ . '/application/config/main.php'); $app = new Application(); $app->merge($config); $app->route()->get($_GET);
/** * Redirect user the the given link under the same domain. * * @param string $path * @return \Koldy\Redirect * @link http://koldy.net/docs/redirect#usage * @link http://koldy.net/docs/url#link */ public static function link($path) { return self::temporary(Application::route()->link($path)); }
/** * Generate URL for asset file depending on configuration for assets located in configs/application.php 'cdn_url'. * This method is using cdn() method in routing class, so be careful because it might be overriden in your case. * * @param string $path * @return string */ public static function cdn($path) { return Application::route()->cdn($path); }
//print_r($_SERVER); exit; require_once '../Bootstrap.php'; Config::setDocumentRoot('/Users/nathan/Projects/Sites/cmsexp'); //class MyHook implements Application_Hook { // // public function preDispatch() { // print_r('pre dispatch'); exit; // } // // public function postDispatch() { // // } //} //Application::setHookListenner(new MyHook()); Application::route($_SERVER['REQUEST_URI']); // //$type = Content_Type::create('page'); //$type->addField('title'); //$type->addField('body'); //$type->save(); //$type = Content_Type::getByName('post'); //$type = Content_Type::getOne('4e1e099833f1f74a22000000'); //$type->delete(); exit; //$type->removeField('author'); //print_r($type); exit; //$content = Content::create('post', array('title' => 'This is a test post', 'body' => 'Lorem ipsum dolor', 'someotherfield' => 'derp2')); //$content = Content::getOne('post', '4e345b5833f1f7f11d020000'); //print_r($content); exit; //echo Content::getOne('post', '4e34596833f1f7f51d010000')->render(); exit; //$page = new Page('main');