tag:help.rocksolidthemes.com,2012-07-23:/discussions/contao/20457-verwendung-select-feld-fr-formularRockSolid Themes: Discussion 2020-05-28T08:47:35Ztag:help.rocksolidthemes.com,2012-07-23:Comment/426049782017-05-22T11:01:08Z2017-05-22T11:01:08ZVerwendung: Select-Feld für Formular<div><p>Produkt: Custom Elements Contao</p>
<p>Guten Tag,<br>
ich brauche ein Feld, in dem ich aus meinen Formularen auswählen kann. Können Sie mir hier weiterhelfen?</p></div>Jan-Markus Langertag:help.rocksolidthemes.com,2012-07-23:Comment/426049782017-05-22T13:53:35Z2017-05-22T13:53:35ZVerwendung: Select-Feld für Formular<div><p>Vielen Dank für Ihre Frage.</p>
<p>Ein Select-Feld das alle Formulare enthält könnte z. B. folgendermaßen aussehen:</p>
<pre>
<code>'form' => array(
'label' => array('Formular', ''),
'inputType' => 'select',
'options_callback' => function() {
$forms = array();
$form = \Database::getInstance()->execute("SELECT id, title FROM tl_form ORDER BY title");
while ($form->next()) {
$forms[$form->id] = $form->title . ' (ID ' . $form->id . ')';
}
return $forms;
},
),</code>
</pre></div>RockSolid Themestag:help.rocksolidthemes.com,2012-07-23:Comment/426049782020-05-28T08:10:23Z2020-05-28T08:16:14ZVerwendung: Select-Feld für Formular<div><p>Wenn man das Formular im Template ausgeben möchte, kann man</p>
<pre>
<code>{{insert_form::<?php echo $this->form ?>}}</code>
</pre>
<p>verwenden.</p></div>jan.kout