nsrosenqvist / cmb2-widget
此包已被弃用且不再维护。未建议替代包。
1.0.1
2018-06-19 09:37 UTC
Requires
- php: >=7.0.0
- cmb2/cmb2: ^2.4.0
This package is auto-updated.
Last update: 2020-06-09 20:10:13 UTC
README
允许您在小部件中使用CMB2
扩展抽象小部件类。
use NSRosenqvist\CMB2\Widgets\CMB2_Widget; class MyWidget extends CMB2_Widget { protected $fields = [ // You can set ID both as the key and in the array 'title' => [ 'name' => __('Title', 'theme'), 'type' => 'text', ], ]; function __construct($id_base, $name, $widget_options = [], $control_options = []) { parent::__construct( // Base ID of widget 'my_widget' // Widget name will appear in UI 'My Widget', // Widget description $widget_options, // Widget options $control_options ); } }