当前位置: 首页>>代码示例>>PHP>>正文


PHP Router::getUrl方法代码示例

本文整理汇总了PHP中Router::getUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Router::getUrl方法的具体用法?PHP Router::getUrl怎么用?PHP Router::getUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Router的用法示例。


在下文中一共展示了Router::getUrl方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Construct this object by extending the base Controller class 
  */
 public function __construct()
 {
     parent::__construct();
     // get project url
     $this->data['project_url'] = Router::getProjectUrl();
     $this->data['current_url'] = Router::getUrl();
 }
开发者ID:WebSupport-DK,项目名称:php-mvc-cms,代码行数:10,代码来源:MenuController.php

示例2: index

 public function index($search)
 {
     $result = Result::convert(parent::index($search));
     $result->addData(array('operation_link_list' => array(function (User $item) {
         return '<a href="' . Router::getUrl('user/updatePassword', array('id' => $item->id)) . '" rel="popup">修改密码</a>';
     })));
     return $result;
 }
开发者ID:sasumi,项目名称:SvnPQA,代码行数:8,代码来源:UserController.php

示例3: initialize

 /**
  * Calls authorize and prepare in this order.
  * The ControllerFactory calls initialize when creating a controller, if $skipInitialization == false
  *
  * If you skip it, make sure you call all methods yourself!
  *
  *
  * @see authorize()
  * @see prepare()
  * @see ErrorMessageException
  */
 public final function initialize()
 {
     $this->router->setCurrentRoute($this->getUrlName(), $this->getUrlAction(), $this->getActionParameters());
     if (($error = $this->router->getUrlError()) !== null) {
         $this->addError($error);
     }
     if (($success = $this->router->getUrlSuccess()) !== null) {
         $this->addSuccess($success);
     }
     try {
         $this->authorize();
         $this->prepare();
     } catch (DatabaseException $e) {
         Log::error($e->getMessage(), 'Controller', array('siteName' => $this->getSiteName()));
         throw new ControllerException('Database error.');
     }
     if ($this->keepInHistory()) {
         $this->container->history->addUrl($this->router->getUrl());
     }
 }
开发者ID:enyo,项目名称:rincewind,代码行数:31,代码来源:Controller.php

示例4: arenaController

                include_once 'controller/arenaController.php';
                $arenaController = new arenaController();
                if ($action != '') {
                    handleFullUrl($arenaController, $action);
                } else {
                    $arenaController->arenaAction();
                }
                break;
            case 'character':
                include_once 'controller/characterController.php';
                $characterController = new CharacterController();
                handleFullUrl($characterController, $action);
                break;
        }
    } else {
        $loginUrl = Router::getUrl('user_login');
        redirectTo($loginUrl);
    }
}
function redirectTo($url)
{
    //if(!strpos($url, 'http://'))
    //	$url = 'http://' . $url;
    header('Location:' . $url);
}
//Automatically choose controller and action basing on url
function handleFullUrl($controller, $action)
{
    $fullActionName = $action . 'Action';
    if (method_exists($controller, $fullActionName)) {
        $controller->{$fullActionName}();
开发者ID:Kavior,项目名称:TitansArena,代码行数:31,代码来源:index.php

示例5: render

    public static function render($code, $params)
    {
        header("HTTP/1.0 503 Service Unavailable");
        switch ($code) {
            case 1:
                if (!Kernel::getDebugMode()) {
                    self::redirect(Router::getUrl("error", "http", array(404)));
                }
                $message = "Controller not found";
                $origin = "class";
                break;
            case 2:
                if (!Kernel::getDebugMode()) {
                    self::redirect(Router::getUrl("error", "http", array(404)));
                }
                $message = "Action not found";
                $origin = "function";
                break;
            case 3:
                if (!Kernel::getDebugMode()) {
                    self::redirect(Router::getUrl("error", "http", array(404)));
                }
                $message = "Theme not found";
                $origin = "theme :";
                break;
            case 4:
                if (!Kernel::getDebugMode()) {
                    self::redirect(Router::getUrl("error", "http", array(404)));
                }
                $message = "Number of required parameters for action has not been reached";
                $origin = "function :";
                break;
            case 5:
                if (!Kernel::getDebugMode()) {
                    self::redirect(Router::getUrl("error", "http", array(404)));
                }
                $message = "Database connection failed";
                $origin = "Message :";
                break;
            default:
                if (!Kernel::getDebugMode()) {
                    self::redirect(Router::getUrl("error", "http", array(404)));
                }
                $message = "Fatal Error catched !";
                $origin = "Message :";
                break;
        }
        ?>
<!DOCTYPE html>
<html>			
	<head>
		<title><?php 
        echo $message;
        ?>
</title>
	</head>
	<body>
		<div style="font-family: 'lucida grande',tahoma,verdana,arial,sans-serif;padding: 30px;border: 1px solid #E5E5E5;background: #F9F9F9;width: 400px;margin: auto;margin-top: 40px;border-radius: 5px;">
		
		
			<span style="font-size: 1.2em;font-weight: bold;"><?php 
        echo $message;
        ?>
</span>
			<pre style="margin-bottom: 0px;white-space : pre-wrap;"><span style="color: grey;"><?php 
        echo $origin;
        ?>
</span> <?php 
        echo $params;
        ?>
</pre>
		</div>
	</body>
</html>
		<?php 
        die;
    }
开发者ID:fozeek,项目名称:framework,代码行数:77,代码来源:Error.php

示例6: array

		<a href="<?php 
echo Router::getUrl("content", "list", array("type" => "comment"));
?>
">
		    <div class="menu-onglet<?php 
if ($header == "comment") {
    ?>
-active<?php 
}
?>
">
			Comments
		    </div>
		</a>
		<a href="<?php 
echo Router::getUrl("parameters", "index");
?>
">
		    <div class="menu-onglet<?php 
if ($header == "parameters") {
    ?>
-active<?php 
}
?>
">
			Paramêtres
		    </div>
		</a>
	    </div>
	</div>
	<?php 
开发者ID:fozeek,项目名称:application,代码行数:31,代码来源:header.php

示例7: generateUrl

 public function generateUrl($route, $parameters = null)
 {
     return Router::getUrl($route, $parameters);
 }
开发者ID:Kavior,项目名称:TitansArena,代码行数:4,代码来源:controller.php

示例8: testGetUrlWrongNumberOfArgumentsForNamedRoutes

 /**
  * @expectedException InvalidArgumentException
  */
 public function testGetUrlWrongNumberOfArgumentsForNamedRoutes()
 {
     $router = new Router();
     $route = new MockRoute_GetLink();
     $router->addRoute('myroute', $route);
     $failed_url = $router->getUrl('myroute', array(':class' => 'myclass', ':method' => 'mymethod'));
 }
开发者ID:neurobashing,项目名称:php-router,代码行数:10,代码来源:RouterTest.php

示例9: DisconnectAction

 public function DisconnectAction($params)
 {
     $this->Auth->disconnect();
     $this->redirect(Router::getUrl("/"));
 }
开发者ID:fozeek,项目名称:application,代码行数:5,代码来源:home.php

示例10: bootstrap

 public function bootstrap()
 {
     // set urls
     $this->data['project_url'] = Router::getProjectUrl();
     $this->data['current_url'] = Router::getUrl();
     // set date format
     $this->data['date_format'] = App::load()->date_format;
     // set default includes
     $this->header = PATH_APP_VIEWS . 'admin/default/assets/inc/_header';
     $this->sidebar = PATH_APP_VIEWS . 'admin/default/assets/inc/_sidebar';
     $this->footer = PATH_APP_VIEWS . 'admin/default/assets/inc/_footer';
 }
开发者ID:WebSupport-DK,项目名称:php-mvc-cms,代码行数:12,代码来源:AdminController.php

示例11:

	var urlDeleteNode = '<?php 
echo Router::getUrl("content", "deletenodeajax");
?>
';

	var urlUpdate = '<?php 
echo Router::getUrl("content", "updateajax");
?>
';
	var urlRemove = '<?php 
echo Router::getUrl("content", "removeajax");
?>
';
	var urlRestore = '<?php 
echo Router::getUrl("content", "restoreajax");
?>
';

	var urlAddChooseBundle= '<?php 
echo Router::getUrl("content", "addchoosebundleajax");
?>
';
	var urlAddForm = '<?php 
echo Router::getUrl("content", "addformajax");
?>
';
	var urlAddSave = '<?php 
echo Router::getUrl("content", "addsaveajax");
?>
';
</script>
开发者ID:fozeek,项目名称:application,代码行数:31,代码来源:meta.php


注:本文中的Router::getUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。