本文整理汇总了PHP中front::view2方法的典型用法代码示例。如果您正苦于以下问题:PHP front::view2方法的具体用法?PHP front::view2怎么用?PHP front::view2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类front
的用法示例。
在下文中一共展示了front::view2方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: group_remove
/**
* 群删日志
*/
public static final function group_remove()
{
// 获取数据
if (!isset($_POST['book_id']) || !is_array($_POST['book_id'])) {
$error = '该日志不存在';
front::view2('error.tpl', compact('error'));
return;
}
// 删除数据
self::deletes(null, null, array('book_id' => $_POST['book_id']), null, __CLASS__);
header('Location: ?' . $_GET['query']);
}
示例2: tree
public static final function tree()
{
$online = front::online();
$channels = self::get_channel();
$docs = self::selects('doc_id,typeid,title,create_date,create_time,update_date,update_time,hit', null, array('user_id' => $online->user_id), array('ORDER BY typeid ASC,doc_id DESC'), array('doc_id', 'assoc|table=doc' => null));
$sites = self::selects('site_id,typeid,title,create_date,create_time,update_date,update_time', null, array('user_id' => $online->user_id), array('ORDER BY typeid ASC,site_id DESC'), array('site_id', 'assoc|table=site' => null));
$adds = self::selects('address_id,typeid,name', null, array('user_id' => $online->user_id), array('ORDER BY typeid ASC,address_id DESC'), array('address_id', 'assoc|table=address' => null));
$diarys = self::selects('diary_id,typeid,title,create_date,create_time,update_date,update_time', null, array('user_id' => $online->user_id), array('ORDER BY typeid ASC,diary_id DESC'), array('diary_id', 'assoc|table=diary' => null));
return front::view2(__CLASS__ . '.' . 'tree.tpl', compact('channels', 'docs', 'sites', 'adds', 'diarys'), null, false);
}
示例3: group_remove
/**
* 群删用户
*/
public static final function group_remove()
{
if (!self::user_level(2, __CLASS__, __FUNCTION__)) {
return;
}
$online = front::online();
// 获取数据
if (!isset($_POST['user_id']) || !is_array($_POST['user_id'])) {
$error = '该用户不存在';
front::view2('common/error.tpl', compact('error'));
return;
}
// 删除数据
self::deletes(null, null, array('user_id' => $_POST['user_id'], 'user_id!=?' => $online->user_id), null, __CLASS__);
header('Location: ?' . $_GET['query']);
}
示例4: index
/**
* 默认动作
*/
public static final function index()
{
front::view2(__CLASS__ . '.' . __FUNCTION__ . '.tpl');
}
示例5: remove
/**
* 删除网址
*/
public static final function remove()
{
// 获取数据
$related = new self();
$related->related_id = isset($_GET['related_id']) ? $_GET['related_id'] : null;
if (!is_numeric($related->related_id) || !$related->select()) {
$error = '该关联不存在';
front::view2('error.tpl', compact('error'));
return;
}
// 删除数据
$related->delete();
header('Location: ?' . $_GET['query']);
}
示例6: login
//.........这里部分代码省略.........
// 表单处理
while ($redirect === null && isset($_SERVER['REQUEST_METHOD']) && ($_SERVER['REQUEST_METHOD'] === 'POST' || $method == 'get' && $_SERVER['REQUEST_METHOD'] === 'GET')) {
// 配置处理
$attribute_array = array('front_class', 'front_table', 'front_fuzzy', 'front_username', 'front_password', 'front_redirect');
list($front_class, $front_table, $front_fuzzy, $front_username, $front_password, $front_redirect) = self::init($attribute_array);
list($front_class2, $front_table2, $front_fuzzy2, $front_username2, $front_password2, $front_redirect2) = parent::init($attribute_array);
$front_class === '' and $front_class = $front_class2;
$front_table === '' and $front_table = $front_table2;
$front_fuzzy === '' and $front_fuzzy = $front_fuzzy2;
$front_username === '' and $front_username = $front_username2;
$front_password === '' and $front_password = $front_password2;
$front_redirect === '' and $front_redirect = $front_redirect2;
// 数据验证
if ($post['username'] === '') {
$error['username'] = '用户名不能为空';
}
if ($post['password'] === '') {
$error['password'] = '密码不能为空';
}
if (!IN_WAP) {
if ($post['authcode'] === '') {
$error['authcode'] = '验证码不能为空';
} elseif (!self::authcode($post['authcode'])) {
$error['authcode'] = '验证码输入不正确';
}
}
if ($error !== array()) {
break;
}
// 密码加密处理
//$post ['password'] = md5 ($post ['password']);
//$front_password = md5 ($front_password);
if (empty($front_class)) {
$front_class = get_parent_class();
}
if ($front_username) {
// 配置项验证
if ($front_fuzzy) {
// 同时验证
if ($front_username !== $post['username'] || $front_password !== md5($post['username'] . md5($post['password']))) {
$error['username'] = $error['password'] = '用户名或密码不正确';
break;
}
} else {
// 分开验证
if ($front_username !== $post['username']) {
$error['username'] = '用户名不存在';
break;
}
if ($front_password !== md5($post['username'] . md5($post['password']))) {
$error['password'] = '密码不正确';
break;
}
}
$online = new $front_class();
$online->username = $post['username'];
$online->password = md5($post['username'] . md5($post['password']));
} else {
// 数据库验证
if (empty($front_table)) {
$front_table = null;
$class_table = 'class|table=' . $front_class;
} else {
$class_table = 'class';
}
if ($front_fuzzy) {
// 同时验证
$online = self::selects(null, $front_table, array('username' => $post['username'], 'password' => md5($post['username'] . md5($post['password']))), null, array($class_table => $front_class));
if (empty($online)) {
$error['username'] = $error['password'] = '用户名或密码不正确';
break;
}
} else {
// 分开验证
$online = self::selects(null, $front_table, array('username' => $post['username']), null, array($class_table => $front_class));
if (empty($online)) {
$error['username'] = '用户名不存在';
break;
}
if ($online->password !== md5($post['username'] . md5($post['password']))) {
$error['password'] = '密码不正确';
break;
}
}
}
// 页面跳转
self::online($online);
if ($post['redirect'] !== '') {
header('Location: ' . $post['redirect']);
} elseif ($front_redirect !== '') {
header('Location: ' . $front_redirect);
} else {
echo 'Require front_redirect.';
}
return false;
}
// 显示模板
front::view2(__CLASS__ . '.' . __FUNCTION__ . '.tpl', compact('error', 'redirect', 'method'));
return false;
}