FormSelectMenu-Widget

Aus Contao Community Documentation

Um ein Selectfeld als Formular-Widget zu definieren, wird es folgendermaßen angelegt und anschließend an das Template übergeben.

<?php
 
...
 
$inputRadius = new FormSelectMenu();
$inputRadius->id = 'searchradius';
$inputRadius->name = 'radius';
$inputRadius->label = 'Umkreis';
$inputRadius->class = 'select';
$inputRadius->value = $this->Input->post('radius');
$inputRadius->options = array( 
	    array('value'=>'', 'label'=>'+0km'),
	    array('value'=>'20','label'=>'+20km'),
	    array('value'=>'50','label'=>'+50km'),
	    array('value'=>'100','label'=>'+100km'),
	    array('value'=>'150','label'=>'+150km'),
	    array('value'=>'200','label'=>'+200km')
);
 
$this->Template->inputRadius = $inputRadius;
...
 
?>

Anschließend kann, wie auch beim FormTextfeld(), das Feld an der gewünschten Position ausgegeben werden.

<?php echo $this->inputRadius->generateLabel();?>
<?php echo $this->inputRadius->generate();?>
Ansichten
Meine Werkzeuge

Contao Community Documentation

<user> Composer meckert bei Isotope, dass er mit tablelookupwizard 3.1 nicht zurecht kommt - korrekt?
<Toflar> keine Ahnung, sowas weiss ich doch nicht auswendig :D
<user> wer dann ;)
<Toflar> na niemand, deswegen schreibt man's ja in die composer.json

Navigation
Verstehen
Verwenden
Entwickeln
Verschiedenes
Werkzeuge