Skip to content

Commit c33eadb

Browse files
committed
Add template for input
1 parent 6f93873 commit c33eadb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/BaseColumn.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ abstract class BaseColumn extends BaseObject
150150
*/
151151
public $columnOptions = [];
152152

153+
/**
154+
* @var string the template of input for customize view.
155+
* For example: '<div class="input-group"><span class="input-group-addon"><i class="fas fa-mobile-alt"></i></span>{input}</div>'
156+
*/
157+
public $inputTemplate = '{input}';
158+
153159
/**
154160
* @var Model|ActiveRecordInterface|array
155161
*/
@@ -326,7 +332,7 @@ public function renderInput($name, $options, $contextParams = [])
326332
$input = $this->renderDefault($name, $value, $options);
327333
}
328334

329-
return $input;
335+
return strtr($this->inputTemplate, ['{input}' => $input]);
330336
}
331337

332338

0 commit comments

Comments
 (0)