Hi,
I made a custom tag “question”. For this I registred a custom button with a modal form.
It works fine. Only one behavior I dont understand. Why I can not use a textarea in my custom form?
If I try, i get this error:
“Method Buttons::__toString() must not throw an exception, caught Error: Call to a member function url() on null”
All other fieldtypes are working. Here is, what I did:
fields/textarea/forms/question.php
<?php
return function($page, $textarea) {
$form = new Kirby\Panel\Form(array(
'question' => array(
'label' => 'Frage',
'type' => 'text',// textarea doesnt work
'placeholder' => '???',
'autofocus' => 'true',
'required' => 'true',
),
'answer' => array(
'label' => 'Antwort',
'type' => 'text', // textarea doesnt work
),
'h' => array(
'label' => 'h',
'type' => 'number',// textarea doesnt work
)
));
$form->data('textarea', 'form-field-' . $textarea);
$form->style('editor');
$form->cancel($page, 'show');
return $form;
};
Do you have any ideas? Thank you.