Closed chris68 closed 10 years ago
Besides: if one uses it like this widget the editor buttons do not work!
For use with a model within active form - use the following approach instead of your cumbersome approach above - this should achieve all your needs and you may not need the widget
method for activeField.
use kartik\markdown\MarkdownEditor;
$form = ActiveForm::begin();
MarkdownEditor::widget([
'model' => $model,
'attribute' => 'description',
'showExport' => false
]);
ActiveForm::end();
I will anyway check on the activefield widget
method in the meanwhile and update if anything else can be enhanced.
Recording an issue for working with model. This will be rectified shortly.
Resolved via commit d6d1a95. You can use the widget with activefield this way:
echo $form->field($model, 'description')->widget(
MarkdownEditor::classname(),
['showExport' => false]
);
Just clean your asset runtime folders and do a composer update to check. Thanks for reporting.
Checking. Works well except for two issues
Resolved via commit c845306. Everything should work now and the widget should default the height to 260px.
Note you can control the textinput height by passing the height
property.
You can hide/show toolbar buttons by passing the toolbar
property. Just remember to pass the buttons correctly to the toolbar by referring to the setDefaultHeader()
method.
Works perfect!
An activeWidget for the intended usage in an ActiveForm would be extremely helpful!
The widget then must fulfill the interface of the routine
widget
in classActiveField
, i.e. the parameter passing must be harmonized (instead of name and value use the model and attribute)Currently one has to use the cumbersome