Source for file Select.php
Documentation is available at Select.php
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at
* http://formagic.weasle.de/licence.txt
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to licence@weasle.de so we can send you a copy immediately.
* @author Florian Sonnenburg
* @copyright Copyright (c) 2007 Florian Sonnenburg
* @license http://formagic.weasle.de/licence.txt New BSD License
* @revision $Revision: 11 $
* @author Florian Sonnenburg
* @copyright Copyright (c) 2007
* @version $Id: Select.php 11 2007-08-12 20:02:57Z meweasle $
* Array containing select options
* Generic argument handler
throw new Exception("Argument type '$key' not supported");
* formagicItemSelect::setData()
* HTML representation of Formagic select item
$str = "[". $this->data[$currVal]. "]";
$str .= '<input type="hidden" name="' . $this->name .
'" value="' . $currVal . '" />';
$str = '<select name="' . $this->name . '" id="' . $this->name . '"' .
foreach($this->data as $key => $value) {
$s = (string) $key == (string) $currVal ? ' selected="selected"' : '';
$str .= "\t<option value=\"" . $key . "\"$s>" . $value . "</option>\n";
|