I was trying to load the textarea field into another field, similar to how datetime
loads the date
and time
fields.
<?php
use Kirby\Panel\Form;
class SplitfieldField extends BaseField {
public function content() {
$textarea = form::field('textarea');
echo $textarea;
}
}
I get this error:
Fatal error: Call to a member function url() on a non-object in C:\wamp\www\splitfield\panel\app\fields\textarea\buttons.php on line 32
- Is it a bug?
- Can I get around it without copy the whole field code?
I register the field from a plugin file like this:
Might be good to know if it can be related to a bug. I also use Kirby 2.3 beta.
$kirby->set('field', 'splitfield', __DIR__ . DS . 'field');
Update
I could do this:
$textarea = form::field('textarea', array('buttons' => false));
echo $textarea;
But then I will not get the buttons. Even if the textarea now work, the assets are not loaded.
Maybe it’s simply not a good way to do this? I just feel like duplicating the whole textarea field (which is quite large) is not the best way, but maybe it is.