Hi there,
Do you know how to create an instance of an existing field type?
I would like to manually generate fields from an array like this one:
<?php
$fields = array(
'sectionname' => array(
'label' => 'Section name',
'type' => 'headline'
),
'fieldname' => array(
'label' => 'Field name',
'type' => 'text'
)
);
It works well with new InputField(); but I have to make a condition on field types to instantiate the correct one for the headline (HeadlineField). I’ve also tested with new Blueprint\Field(); but it just doesn’t seem to work (I can’t get any HTML output).
I’ve tried looking in the panel source but I can’t manage to find the part that creates fields from a YAML and enable having an HTML output.
Any idea?