Bid history refresh added (by ajax)/ Ajax root class added
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@27 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @copyright
|
||||
* @link
|
||||
*
|
||||
* @copyright
|
||||
* @link
|
||||
* @package Majestic
|
||||
* @subpackage PageController
|
||||
* @since
|
||||
* @since
|
||||
* @version SVN: $Id$
|
||||
* @filesource $URL$
|
||||
*/
|
||||
@ -21,8 +21,9 @@ final class PageController
|
||||
{
|
||||
try {
|
||||
$this->route = Load::router()->proccess(MJ_PATH);
|
||||
$action = new $this->route->action;
|
||||
$decorator = new $this->route->decorator;
|
||||
return $decorator->display(new $this->route->action);
|
||||
return $decorator->display($action);
|
||||
} catch (MJException $e) {
|
||||
return $e->terminate();
|
||||
} catch (Exception $e) {
|
||||
|
@ -1,24 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Класс для работы с роутерами
|
||||
* Класс для работы с роутерами
|
||||
*
|
||||
* @copyright
|
||||
* @link
|
||||
* @copyright
|
||||
* @link
|
||||
* @package Majestic
|
||||
* @subpackage Core
|
||||
* @since
|
||||
* @since
|
||||
* @version SVN: $Id$
|
||||
* @filesource $URL$
|
||||
*/
|
||||
|
||||
final class Router
|
||||
{
|
||||
|
||||
|
||||
protected $routes = array();
|
||||
|
||||
|
||||
static protected $rewrite_base = '';
|
||||
static protected $decorator = DEFAULT_DECORATOR;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Добавить роутер
|
||||
@ -55,8 +55,14 @@ final class Router
|
||||
*/
|
||||
function proccess($path)
|
||||
{
|
||||
$path = explode('/', ltrim($path, self::getRewriteBase()));
|
||||
|
||||
if ($trim = self::getRewriteBase()) {
|
||||
if (substr($path, 0 , strlen($trim)) == $trim) {
|
||||
$path = substr($path, strlen($trim));
|
||||
}
|
||||
}
|
||||
|
||||
$path = explode('/', $path);
|
||||
|
||||
foreach($this->routes as $name => $route) {
|
||||
if ($route->match($path)) {
|
||||
$route->action .= ACTION_POSTFIX;
|
||||
@ -66,17 +72,17 @@ final class Router
|
||||
}
|
||||
throw new Exception(E_404);
|
||||
}
|
||||
|
||||
|
||||
static public function setRewriteBase($value = '')
|
||||
{
|
||||
self::$rewrite_base = $value;
|
||||
}
|
||||
|
||||
|
||||
static public function getRewriteBase()
|
||||
{
|
||||
return self::$rewrite_base;
|
||||
}
|
||||
|
||||
|
||||
static public function setDefaultDecorator($decorator)
|
||||
{
|
||||
self::$decorator = $decorator.DECORATOR_POSTFIX;
|
||||
|
Reference in New Issue
Block a user