本文整理汇总了PHP中UI::init方法的典型用法代码示例。如果您正苦于以下问题:PHP UI::init方法的具体用法?PHP UI::init怎么用?PHP UI::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UI
的用法示例。
在下文中一共展示了UI::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: core_msg
public static function core_msg($type = '')
{
$msg_array = \CORE::init()->get_msg_arr();
$styles = array('error' => 'danger', 'info' => 'info', 'debug' => 'warning');
if ($type != '') {
if (isset($msg_array[$type])) {
if ($msg_array[$type] != '') {
echo UI::init()->core_msg_show($type, $styles[$type], $msg_array[$type]);
}
}
} else {
foreach ($msg_array as $type => $msg) {
if ($msg != '') {
echo UI::init()->core_msg_show($type, $styles[$type], $msg);
}
}
}
}
示例2: __construct
private function __construct($REQUEST, $modules)
{
if ($REQUEST->get('c') == '') {
UI::init()->static_page('home');
} else {
if (isset($modules[$REQUEST->get('c')])) {
// \CORE::msg('debug','Controller: '.$REQUEST->get('c'));
$model = null;
$view = null;
$controller = null;
$p2 = strtoupper($REQUEST->get('c'));
$path = array('m' => '', 'v' => '', 'c' => '');
if ($modules[$REQUEST->get('c')] == 0) {
$p1 = 'CORE\\MVC\\';
$path['m'] = $p1 . 'M\\' . $p2 . '_M';
$path['v'] = $p1 . 'V\\' . $p2 . '_V';
$path['c'] = $p1 . 'C\\' . $p2 . '_C';
} else {
$p1 = 'APP\\MVC\\';
$path['m'] = $p1 . 'M\\' . $p2 . '_M';
$path['v'] = $p1 . 'V\\' . $p2 . '_V';
$path['c'] = $p1 . 'C\\' . $p2 . '_C';
}
if (class_exists($path['c'])) {
if (\SEC::init()->acl($REQUEST->get('c'), $REQUEST->get('act'))) {
// access control ($USER)
if (class_exists($path['m'])) {
$model = new $path['m']();
}
if (class_exists($path['v'])) {
$view = new $path['v']();
}
$controller = new $path['c']($REQUEST, $model, $view);
}
} else {
\CORE::msg('error', 'Module not loaded');
}
} else {
\CORE::msg('error', 'Unregistered module');
UI::init()->static_page('home');
}
}
}