我正在尝试在 Joomla 中构建一个组件,我希望一个项目属于多个类别。
每当我在 xml 表单中选择 ]multiple=multiple 并提交表单时,catid 设置为零。
//this is the code
<code section>
<field
name="catid"
multiple="multiple"
type="category">
<option value="0">JOPTION_SELECT_CATEGORY</option>
</field>
How do I achieve that?
Secondly where is code to insert catid values in db.
protected function loadFormData()
{
// Check the session for previously entered form data.
$data = JFactory::getApplication()->getUserState('com_xyz.edit.xyz.data', array());
if (empty($data))
{
$data = $this->getItem();
}
print_r($data);
return $data;
}
任何人都可以帮我解决这个问题...