phpbe/ui-admin-editor

后台编辑器插件

2.1.2 2018-10-12 03:52 UTC

README

示例

在 BE 框架中使用:

<?php
use Phpbe\System\Be;

$uiAdminEditor = Be::getUi('AdminEditor');
$uiAdminEditor->setFields(
    [
        'type' => 'text',
        'name' => 'username',
        'label'=> '用户名',
        'value' => '',
        'width' => '200px',
        'required' => '请输入用户名'
    ],
    [
        'type' => 'text',
        'name' => 'name',
        'label' => '呢称',
        'value' => '',
        'width' => '200px',
        'validate' => [
            'required' => true
        ],
        'message' => [
            'required' => '请输入呢称'
        ]
    ],
    [
        'type' => 'radio',
        'name' => 'sex',
        'label' => '性别',
        'value' => '',
        'options' => [
            '0' => '',
            '1' => ''
        ]
    ]
);

$uiAdminEditor->setAction('save', adminUrl('Cms', 'Article', 'edit'));
$uiAdminEditor->setAction('back', true);
$uiAdminEditor->display();
// ...