本文整理汇总了PHP中Web::dispatch方法的典型用法代码示例。如果您正苦于以下问题:PHP Web::dispatch方法的具体用法?PHP Web::dispatch怎么用?PHP Web::dispatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Web
的用法示例。
在下文中一共展示了Web::dispatch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
<?php
define('DEBUG', true);
$root = realpath(dirname(__FILE__));
$urls = array('^/$' => 'Principal', '^/ingresar$' => 'Ingresar', '^/ingresar/amnesia$' => 'IngresarAmnesia', '^/personas$' => 'Personas', '^/personas/(\\d+)$' => 'PersonasVer', '^/personas/(\\d+)/editar$' => 'PersonasEditar', '^/empresas$' => 'Empresas', '^/empresas/agregar$' => 'EmpresasAgregar', '^/empresas/(\\d+)$' => 'EmpresasVer', '^/empresas/(\\d+)/editar$' => 'EmpresasEditar', '^/empresas/(\\d+)/personas$' => 'EmpresasPersonas', '^/empresas/(\\d+)/personas/agregar$' => 'EmpresasPersonasAgregar', '^/configuracion$' => 'Configuracion', '^/configuracion/apariencia$' => 'ConfiguracionApariencia', '^/salir$' => 'Salir');
include_once "{$root}/config.php";
if (DEBUG) {
error_reporting(E_ALL);
}
include_once "{$root}/lib/Request.php";
include_once "{$root}/lib/Response.php";
include_once "{$root}/lib/Web.php";
include_once "{$root}/lib/WebBase.php";
include_once "{$root}/lib/Cookies.php";
include_once "{$root}/lib/Validation.php";
include_once "{$root}/lib/String.php";
include_once "{$root}/lib/Lang.php";
include_once "{$root}/lib/Db.php";
include_once "{$root}/lib/Config.php";
include_once "{$root}/lib/Session.php";
Db::open($dbConfig);
Cookies::$prefix = 'EME_';
Session::start();
Web::errorRegister(404, 'Error404');
Web::dispatch($urls);
Db::close();