本文整理汇总了PHP中Dispatcher::invoke方法的典型用法代码示例。如果您正苦于以下问题:PHP Dispatcher::invoke方法的具体用法?PHP Dispatcher::invoke怎么用?PHP Dispatcher::invoke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dispatcher
的用法示例。
在下文中一共展示了Dispatcher::invoke方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
<?php
define('ROOT_DIR', dirname(dirname(__DIR__)) . '/');
define('APP_DIR', ROOT_DIR . '/app/');
// PHP5.4 built-in web server support
if (php_sapi_name() === 'cli-server') {
$cli_filepath = preg_replace('/(\\?.*)\\z/', '', $_SERVER['REQUEST_URI']);
if (is_file(__DIR__ . $cli_filepath)) {
return false;
}
$_REQUEST['dc_action'] = preg_replace('/\\A\\//', '', $cli_filepath);
}
require_once ROOT_DIR . 'vendor/dietcake/dietcake/dietcake.php';
require_once CONFIG_DIR . 'bootstrap.php';
require_once CONFIG_DIR . 'core.php';
Dispatcher::invoke();
示例2:
<?php
require __DIR__ . '/../core/Dispatcher.php';
Dispatcher::invoke(['controller_dir' => __DIR__ . '/controller/', 'view_dir' => __DIR__ . '/views/', 'ignore_path' => '\\/sample']);
示例3: Dispatcher
<?php
/**
* Copyright (c) 2015 by Robin Wieschendorf. All Rights
* Reserved. Proprietary and Confidential - This source code is not for
* redistribution.
*/
require_once '../library/core.php';
/*****************
* SCRIPT - START *
******************/
$dispatcher = new Dispatcher();
$dispatcher->setDefaultRoute(['app', 'module', 'id', 'action']);
$dispatcher->setIndexApp('public');
$dispatcher->setIndexModule('index');
$dispatcher->invoke();