toastnz/silverstripe-design-field
最新稳定版本:0.1.1
Composer 安装命令:
composer require toastnz/silverstripe-design-field
包简介
Silverstripe Design Field
关键字:
README 文档
README
#Silverstripe Design Field A field that can generate inline styles for an object. The field is saved into the database as a JSON string. Here's an example of the output:
{
"selector":".myobject",
"padding-top":"100px",
"padding-bottom":"100px",
"margin-top":"10px",
"margin-bottom":"10px",
"background":"#ffffff"
}
###Methods Summary
- | -
---- | ----
public | __construct($name, $title = null, $selector = null, $fields = null, $value = null)
The $fields parameter supports pretty much all silverstripe fields, bar UploadFields and FileFields.
###Screenshot
###Example Usage
private static $db = array( 'MyObject' => 'Design' );
DesignField::create('MyObject', _t('DesignField.MyObject', 'My Object'), '.myobject', array( 'padding-top' => 'TextField', 'padding-right' => 'TextField', 'padding-bottom' => 'TextField', 'padding-left' => 'TextField', 'margin-top' => 'TextField', 'margin-right' => 'TextField', 'margin-bottom' => 'TextField', 'margin-left' => 'TextField', 'color' => 'ColorField', 'background' => 'ColorField', 'font-size' => array( 'type' => 'DropdownField', 'value' => array( '16px', '25px', '36px' ) ) ));
Return the string of styles
$this->dbObject('MyObject')->InlineStyle();
统计信息
- 总下载量: 42
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-09-11