/** * 路由重定向 * @param $c * @param string $a * @param string $m * @param array $params * @param string $routerType */ public function redirectTo($c, $a = 'index', $m = 'default', array $params = [], $routerType = 'default') { if ($m == 'default') { $m = $this->_request->getModuleName(); } $url = \Util_Helper::url($c, $a, $m, $params, $routerType); $this->redirect($url); die; }
public function testUrl() { $s = Util_Helper::url('index', 'index', 'admin', ['a' => 1, 'b' => 2]); $this->assertEquals('/admin/index/index/a/1/b/2', $s); }
public function userListAction() { $params['page'] = $this->get('page'); $params['name'] = $this->get('name'); $params['email'] = $this->get('email'); $whereCondition = []; if ($params['name']) { $whereCondition['name[~]'] = $params['name']; } if ($params['email']) { $whereCondition['email[~]'] = $params['email']; } if ($whereCondition) { $where['AND'] = $whereCondition; } $where["LIMIT"] = Util_Pagination::getLimit($params['page']); $result = $this->rbacManage->getUserList('*', $where); Util_Pagination::config($result['count'], Util_Helper::url('rbacmanage', 'userList'), $params['page'], $whereCondition); $this->getView()->dataList = $result; $this->getView()->params = $params; return true; }