I'm facing a strange problem. I'm trying to define a custom field for the frontend-view of my component like this:
defined('JPATH_BASE') or die;
jimport('joomla.form.formfield');
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
class JFormFieldAssignToUser extends JFormFieldList
{
protected $type = 'assigntouser';
protected function getInput()
{
$html = array();
$user = JFactory::getUser();
$html[] = JHtml::_('select.option', "Test", "Test");
$html = array_merge(parent::getOptions(), $html);
return $html;
}
}
now I'm adding this to my xml:
<field name = "assigntouser"
type = "assigntouser"
label = "TEST"
description = "TEST"
filter = "safehtml"
default = "">
<option value = "">TEST</option>
</field>
and include it to my layout like that:
<?php echo $this->form->renderFieldset("testfieldset"); ?>
But it only shows this error:
Notice: Array to string conversion in /var/www/web1/htdocs/layouts/joomla/form/renderfield.php on line 35
A field, which is designed in the same way, that is added to the backend of Joomla, works without problems...