dnadesign/silverstripe-embed
Composer 安装命令:
composer require dnadesign/silverstripe-embed
包简介
Adds embed and video a dataobject along with dataextension to apply embed to existing objects.
关键字:
README 文档
README
Adds embed and video a dataobject along with dataextension to apply embed to existing objects.
Installation
Composer is the recommended way of installing SilverStripe modules.
composer require gorriecoe/silverstripe-embed
Requirements
- silverstripe/framework ^4.0
Maintainers
Usage
Relationship to Embed Dataobjects
use gorriecoe\Embed\Models\Embed; class ClassName extends DataObject { private static $has_one = [ 'Embed' => Embed::class, 'Video' => Video::class ]; public function getCMSFields() { ... $fields->addFieldsToTab( 'Main', [ HasOneButtonField::create( 'Embed', 'Embed', $this ), HasOneButtonField::create( 'Video', 'Video', $this ) ] ); ... } }
Update current DataObject to be Embeddable with DataExtension
use gorriecoe\Embed\Extensions\Embeddable; class ClassName extends DataObject { private static $extensions = [ Embeddable::class, ]; /** * List the allowed included embed types. If null all are allowed. * @var array */ private static $allowed_embed_types = [ 'video', 'photo' ]; /** * Defines tab to insert the embed fields into. * @var string */ private static $embed_tab = 'Main'; }
统计信息
- 总下载量: 2.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2022-12-20