Is there a chance in Yii2 redactor to use full html support including html, head, body, meta tags etc.? Or, maybe, there is another WYSIWYG editor which allow those tags?
Asked
Active
Viewed 583 times
3
-
Why can't you just write them into redactor anyway? What you do with the input from redactor is up to you. Just allow those tags when you purify the input? – Jonnny Jan 21 '16 at 00:30
1 Answers
0
You can use tinymce yii2 widget to put full html content, look at this example:
<?= $form->field($model, 'description')->widget(TinyMce::className(), [
'options' => ['rows' => 6],
'language' => 'ar',
'clientOptions' => [
'plugins' => [],
'toolbar' => "forecolor | undo redo | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
]
]);?>
You can here use or add any option you like....
or you can use CKEditor widget
<?= $form->field($model, 'description')->widget(CKEditor::className(), [
'options' => ['rows' => 6],
'preset' => 'full',
'clientOptions' => ['allowedContent' => true]
]) ?>
This widget using CKEditor, and you can pass preset full as an option to access full html option.
Or if you need to use redactor you need to put custom client js code which its edit configuration like this:
$R('#content', {
source: {
codemirror: {
lineNumbers: true
}
}
});
Look for this features: here.

Anees Hikmat Abu Hmiad
- 3,460
- 2
- 19
- 36