1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00
php-e107/e107_handlers/e107Url.php

111 lines
1.7 KiB
PHP
Raw Normal View History

2008-11-25 16:26:03 +00:00
<?php
/*
* e107 website system
*
2012-05-11 09:54:12 +00:00
* Copyright (C) 2008-2012 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* URL Handler
*
* $URL$
* $Id$
2008-11-25 16:26:03 +00:00
*/
2009-09-14 18:19:17 +00:00
if (!defined('e107_INIT')) { exit; }
/**
*
*/
class eUrl
2008-11-25 16:26:03 +00:00
{
protected $_front;
2009-09-14 18:19:17 +00:00
public function __construct()
2008-11-25 16:26:03 +00:00
{
$front = eFront::instance();
if(null === $front->getRequest())
2008-11-25 16:26:03 +00:00
{
// init
$request = new eRequest();
$front->setRequest($request);
$dispatcher = new eDispatcher();
$front->setDispatcher($dispatcher);
$router = new eRouter();
$front->setRouter($router);
$response = new eResponse();
$front->setResponse($response);
2008-11-25 16:26:03 +00:00
}
$this->_front = $front;
2009-09-25 20:17:48 +00:00
}
/**
* @param $route
* @param $params
* @param $options
* @return string
*/
public function create($route, $params = array(), $options = array())
{
return $this->router()->assemble($route, $params, $options);
2008-11-25 16:26:03 +00:00
}
/**
* @param $route
* @param $params
* @param $options
* @return string
*/
public function sc($route, $params = array(), $options = array())
{
return $this->router()->assembleSc($route, $params, $options);
}
2009-09-25 20:17:48 +00:00
/**
* @return eRouter
2009-09-25 20:17:48 +00:00
*/
public function router()
2009-09-25 20:17:48 +00:00
{
return $this->_front->getRouter();
2009-09-25 20:17:48 +00:00
}
/**
* @return eDispatcher
2009-09-25 20:17:48 +00:00
*/
public function dispatcher()
2009-09-25 20:17:48 +00:00
{
return $this->_front->getDispatcher();
2009-09-25 20:17:48 +00:00
}
/**
* @return eFront
2009-09-25 20:17:48 +00:00
*/
public function front()
2009-09-25 20:17:48 +00:00
{
return $this->_front;
2008-11-25 16:26:03 +00:00
}
2012-05-11 09:54:12 +00:00
/**
* @return eResponse
*/
public function response()
{
return $this->_front->getResponse();
}
/**
* @return eRequest
*/
public function request()
{
return $this->_front->getRequest();
}
2008-11-25 16:26:03 +00:00
}