Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable or remove Yii2 redactor Image and file button?

Tags:

php

yii2

redactor

I am using Yii2 Redactor from Here. I want to remove Image and File Upload.

view Code :

<?= $form->field($model, 'reason')->widget(
\yii\redactor\widgets\Redactor::className(), [])

 ?>

Screenshot

Screen shot

like image 924
Kakul Sarma Avatar asked May 28 '18 06:05

Kakul Sarma


1 Answers

If you want to hide the buttons for all instances of Redactor you can add this into the module config

'modules' => [
    'redactor' => [
        'class' => 'yii\redactor\RedactorModule',
        'widgetClientOptions' => [
            'buttonsHide' => ['image','file'],
        ]
    ],
],

Otherwise you can add this to the individual call

<?= $form->field($model, 'reason')->widget(\yii\redactor\widgets\Redactor::className(), [
    'clientOptions' => [
        'buttonsHide' => ['image','file'],
    ]
])?>
like image 104
Ed209 Avatar answered Nov 11 '22 02:11

Ed209