asprin
Active member
I've an entity defined as follows:
It contains data as follows:
Is there a way I can pull this data and create a select from it as part of a form that I will show on a page?
I'm aware that to render a select, I'll have to use the following format:
But just not sure how to grab data from database and use it in the above format.
PHP:
public static function getStructure(Structure $structure)
{
$structure->table = 'xf_fc_categories';
$structure->shortName = 'FC:Categories';
$structure->primaryKey = 'id_category';
$structure->columns = [
'id_category' => ['type' => self::INT, 'required' => true],
'category_title' => ['type' => self::STR , 'required' => true]
];
$structure->getters = [];
$structure->relations = [];
return $structure;
}
It contains data as follows:
Is there a way I can pull this data and create a select from it as part of a form that I will show on a page?
I'm aware that to render a select, I'll have to use the following format:
HTML:
<xf:select>
<xf:option value="1">
orange
</xf:option>
<xf:option value="2">
apple
</xf:option>
<xf:option value="3">
banana
</xf:option>
</xf:select>
But just not sure how to grab data from database and use it in the above format.
Last edited: