You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.1 KiB
29 lines
1.1 KiB
<?php
|
|
|
|
namespace App\Forms;
|
|
|
|
use Kris\LaravelFormBuilder\Form;
|
|
use Kris\LaravelFormBuilder\Field;
|
|
|
|
class PermissionForm extends Form
|
|
{
|
|
public function buildForm()
|
|
{
|
|
$this->add("id", Field::HIDDEN);
|
|
$this->add("pid", Field::HIDDEN, ["default_value" => 0]);
|
|
$this->add("pname", Field::TEXT, ["label" => "父菜单", "attr" => ["disabled" => true]]);
|
|
$this->add("name", Field::TEXT, ["label" => "名称", "rules" => "required"]);
|
|
$this->add("url", Field::TEXT, ["label" => "菜单路径"]);
|
|
$this->add("visible", Field::SELECT, ["label" => "是否显示", "choices" => [
|
|
"1" => "显示",
|
|
"0" => "隐藏"
|
|
]]);
|
|
$this->add("icon", Field::TEXT, ["label" => "图标样式"]);
|
|
$this->add("myindex", Field::NUMBER, ["label" => "排序", "value" => 0]);
|
|
$this->add('buttons', 'buttongroup', ["splitted" => true, "buttons" => [
|
|
["label" => "保存", "attr" => ["class" => "btn btn-primary mr-1", "type" => "submit"]],
|
|
["label" => "返回", "attr" => ["class" => "btn btn-light btn-back", "type" => "button"]]
|
|
]]);
|
|
}
|
|
}
|