示例#1
0
 /**
  * ディスパッチャーを起動します
  * @param \radium\action\Request $request 
  */
 public static function run(Request $request)
 {
     $dispatcher = new Dispatcher($request);
     list($controllerObj, $data) = $dispatcher->dispatch();
     $contentType = '';
     $output = '';
     if (is_string($data) || is_numeric($data) || is_bool($data)) {
         $output = $data;
         $contentType = 'text/plain';
     } else {
         $controllerObj->invokeMethod('_finalize', $data ? array($data) : array());
         $output = $controllerObj->renderedContent();
         $contentType = $controllerObj->view->contentType();
     }
     header('Content-Type: ' . $contentType . '; charset=UTF-8');
     echo $output;
 }
示例#2
0
文件: index.php 项目: nariyu/radium
<?php

/**
 * radium: the most RAD PHP Framework
 *
 * @copyright Copyright 2012, Playwell Inc.
 * @license   http://opensource.org/licenses/bsd-license.php The BSD License
 */
// ブートストラップ
require dirname(__DIR__) . '/conf/bootstrap.php';
// ディスパッチャーを起動
echo \radium\action\Dispatcher::run(new \radium\net\http\Request());