本文整理汇总了PHP中JS::js_back方法的典型用法代码示例。如果您正苦于以下问题:PHP JS::js_back方法的具体用法?PHP JS::js_back怎么用?PHP JS::js_back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JS
的用法示例。
在下文中一共展示了JS::js_back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle_catelog_center
function handle_catelog_center($config)
{
if (!isset($config['model']) or !isset($config['name'])) {
die('参数错误!');
}
$_model = model($config['model']);
$this->swoole->tpl->assign('act_name', $config['name']);
if (empty($config['tpl.add'])) {
$config['tpl.add'] = LIBPATH . '/data/tpl/admin_catelog_center_add.html';
}
if (empty($config['tpl.list'])) {
$config['tpl.list'] = LIBPATH . '/data/tpl/admin_catelog_center_list.html';
}
if (isset($config['limit']) and $config['limit'] === true) {
$this->swoole->tpl->assign('limit', true);
} else {
$this->swoole->tpl->assign('limit', false);
}
if (isset($_GET['add'])) {
if (!empty($_POST['name'])) {
$data['name'] = trim($_POST['name']);
$data['pagename'] = trim($_POST['pagename']);
$data['fid'] = intval($_POST['fid']);
$data['intro'] = trim($_POST['intro']);
$data['keywords'] = trim($_POST['keywords']);
#增加
if (empty($_POST['id'])) {
$_model->put($data);
JS::js_back('增加成功!');
} else {
$_model->set((int) $_POST['id'], $data);
JS::js_back('修改成功!');
}
} else {
if (!empty($_GET['id'])) {
$data = $_model->get((int) $_GET['id'])->get();
$this->swoole->tpl->assign('data', $data);
}
$this->swoole->tpl->display($config['tpl.add']);
}
} else {
if (!empty($_GET['del'])) {
$del_id = intval($_GET['del']);
$_model->del($del_id);
JS::js_back('删除成功!');
}
//Error::dbd();
$get['fid'] = empty($_GET['fid']) ? 0 : (int) $_GET['fid'];
$get['page'] = empty($_GET['page']) ? 1 : (int) $_GET['page'];
$get['pagesize'] = 15;
$pager = null;
$list = $_model->gets($get, $pager);
$this->swoole->tpl->assign('list', $list);
$this->swoole->tpl->assign('pager', array('total' => $pager->total, 'render' => $pager->render()));
$this->swoole->tpl->display($config['tpl.list']);
}
}