'can' => $this->_can, 'can_write' => $this->_canWrite, 'auth' => $this->_auth,
'database_type' => $this->_databaseType, 'database_unique' => $this->_databaseUnique, 'database_index' => $this->_databaseIndex, 'database_default' => $this->_databaseDefault, 'database_length' => $this->_databaseLength,
'fake' => false, 'store_in' => 'extras', 'attributes' => [],
- 'field_attributes.placeholder' => $this->_placeholder,
+ 'placeholder' => $this->_placeholder,
];
}
protected function getFieldAttributes()
{
$res = [];
+
+ $fieldAttributes = ['placeholder', 'rows'];
+
foreach ($this->_attributes as $k => $v) {
if (null === $v) {
continue;
}
- if (strstr($k, 'field_attributes.')) {
+ if (in_array($k, $fieldAttributes)) {
+ Arr::set($res, $k, $v);
+ } else if (strstr($k, 'field_attributes.')) {
$e = explode('.', $k, 2);
Arr::set($res, $e[1], $v);
}
protected $_translatable = true;
protected $_columnType = 'textarea';
protected $_columnViewNamespace = CubistBackpackServiceProvider::NAMESPACE . '::columns';
- protected $_fieldHeight = 7;
+ protected $_rows = 7;
public function getDefaultAttributes()
{
- return array_merge(parent::getDefaultAttributes(), ['field_attributes.rows' => $this->_fieldHeight]);
+ return array_merge(parent::getDefaultAttributes(), ['rows' => $this->_rows]);
}
}