unsetTexteditor

unsetTexteditor(array $fields)

The function unsetTexteditor is really rare to use as by default there is not any load of the texteditor for optimising purposes (too big file). It maybe used in case you are enabling all the text-editors by default and then you need to disable it.

The syntax is simple, for example:

$crud->unsetTexteditor(['notes', 'full_text']);

To understand better the functionality of the unsetTexteditor we have the below example:

$crud->setTable('film');
$crud->setSubject('Film', 'Films');
$crud->setTexteditor(['description']);

$crud->unsetTexteditor(['description']);

$output = $crud->render();

Of course we can understand that it doesn't make any sense to have setTexteditor and then unsetTexteditor right after, however have in mind that this is just an example. The above code is equivalent to the below:

$crud->setTable('film');
$crud->setSubject('Film', 'Films');

$output = $crud->render();

That simply means that the default status of a textarea is without the texteditor.

A more real world example could be to have something like that:


if (user_text_editor_not_allowed()) {
   $crud->unsetTexteditor(['description']);
}

Below you can see an example by unsetting the 'description' field to have a texteditor.