1. Go to this page and download the library: Download quansitech/antd-admin library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use AntdAdmin\Component\Form\ColumnsContainer;
class ExtraProvider implements Provider{
public function register(){
// 注册 AntdAdmin Extra 列类型
ColumnsContainer::registerType('extra', ExtraColumn::class);
...
}
...
}
// 然后就可以使用
/** @var $container AntdAdmin\Component\Form\ColumnsContainer */
$container->extra('extra', '额外表单项');
use AntdAdmin\Component\ColumnType\BaseColumn;
class Extra extends BaseColumn {
protected function getValueType(): string
{
return 'extra'; //与前端组件名对应
}
}