本文整理汇总了PHP中utils::key_exists方法的典型用法代码示例。如果您正苦于以下问题:PHP utils::key_exists方法的具体用法?PHP utils::key_exists怎么用?PHP utils::key_exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils
的用法示例。
在下文中一共展示了utils::key_exists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_db_config
public static function set_db_config($db_config)
{
if (!utils::key_exists(array("host", "user", "pass", "name", "tpfx"), $db_config)) {
throw new Exception("Invalid Database Connection Information.");
}
self::$db_config = $db_config;
self::$tbl_pfx = $db_config['tpfx'];
}
示例2: _init
protected static function _init($settings)
{
if (!utils::key_exists(array("table", "class"), $settings)) {
die("Active Record: Invalid Configuration");
}
self::$tbl_pfx = parent::$tbl_pfx;
self::$settings = $settings;
self::make_instance();
}
示例3: route
public static function route($config, $re_route)
{
$router_vars = self::get_router_vars($config);
if (count($router_vars) > 1) {
if (utils::key_exists(array($router_vars['controller']), $re_route)) {
if (in_array($router_vars['action'], $re_route[$router_vars['controller']])) {
$router_vars['controller'] = $router_vars['action'];
$router_vars['action'] = !empty($router_vars['fnc_args']) ? $router_vars['fnc_args'][0] : $config['action'];
if (count($router_vars['fnc_args']) > 1) {
array_shift($router_vars['fnc_args']);
} else {
$router_vars['fnc_args'] = array();
}
}
}
}
if ($router_vars['controller'] == "base") {
$router_vars['controller'] = $config['class'];
}
if (!file_exists(APP . 'controllers' . DS . $router_vars['controller'] . '.php')) {
throw new NotFoundException();
}
require_once APP . 'controllers' . DS . $router_vars['controller'] . '.php';
if (!class_exists($router_vars['controller'])) {
throw new NotFoundException();
}
$instance = new $router_vars['controller']();
if (!method_exists($instance, $router_vars['action'])) {
throw new NotFoundException();
}
$instance->{$router_vars}['action']($router_vars['fnc_args'], $router_vars['gets']);
if (DEBUG) {
debug::set("router", "router", $router_vars);
debug::set("session", "session", session::get_all());
debug::show();
}
}