Repeatable Group Element Field
Parameter | Type | Value |
---|---|---|
type | required |
Predefined String (repeatable) |
title | optional |
String |
desc | optional |
String |
attr | optional |
Array |
std | optional |
Array |
tab | optional |
String(style) |
section | optional |
String |
Always return object
'repeatable_item' => array(
'title' => 'Repeatable Item',
'type' => 'repeatable',
'attr' => array(
'icon_list' => array(
'type' => 'iconsocial',
'title' => 'Iconsocial Field',
'std' => 'fa fa-facebook'
),
'social_url' => array(
'type' => 'text',
'title' => 'Add social URL',
'std' => '#'
),
),
'std' => array(
array(
'icon_list' => 'fa fa-twitch',
'social_url' => '#',
),
array(
'icon_list' => 'fa fa-twitter',
'social_url' => '#',
),
),
)
Inside the rander()
method-
echo '<div>';
foreach ( $settings['repetable_check'] as $key => $value ){
echo $value['icon_list'];
echo $value['social_url'];
}
echo '</div>';
Inside the getTemplate()
method-
<div>
<# _.forEach(data.repetable_check, function(value, key) { #>
{{value.icon_list}}
{{value.social_url}}
<# }) #>
</div>