public function listTable() { $table = new KTable(); $thead = new TableHead('name'); $thead->setSearchable(); $thead->setSortable(); $thead->setHtml('角色名'); $table->addThead($thead); $thead = new TableHead('display_name'); $thead->setSearchable(); $thead->setHtml('角色描述'); $table->addThead($thead); $thead = new TableHead('action'); $thead->setHtml('操作'); $thead->setFunc(function (Role $role) { return ButtonUtils::block_btn_edit($this, $role); }); $table->addThead($thead); return $table; }
/** * @param TableHead $thead * @return $this */ public function addThead(TableHead $thead) { $this->thead[$thead->getField()] = $thead; return $this; }