public function dataTable() { Doo::loadClassAt('html/DataTable', 'default'); $dt = new DataTable(); function table_button($row, $rowData) { $modUrl = RoleController::$modUrl . $rowData['id']; $delUrl = RoleController::$delUrl . $rowData['id']; $a = '<a href="' . $modUrl . '" class="blue-stripe btn mini">修改</a>'; $a .= ' <a href="' . $delUrl . '" class="red-stripe btn mini js-datatable-del">删除</a>'; return $a; } $header = array('id' => 'ID', 'name' => '角色名', 'table_button_action' => array('name' => '操作', 'callback' => 'table_button')); Doo::loadClassAt('Role', 'default'); $role = new role(); $data = $role->get_list(); $content = $dt->setTitle('')->setAttr(array('class' => 'table'))->setHeader($header)->setData($data)->setDefaultValue('unkown')->setTopContent('<a href="' . RoleController::$addUrl . '" class="btn green-stripe"><i class="icon-plus"></i>新增角色</a>')->render(false); $this->contentlayoutRender($content); }