src/lib/FormOptions.php
static public function fromArrayCallback(array $data, callable $callback) {
		$ret = new FormOptions();
		foreach ( $data as $item ){
			list($value, $text) = $callback($item);
			$ret->add($value, $text);
		}
		return $ret;
	}
static public function fromArrayCallback(array $data, callable $callback) {
		$ret = new FormOptions();
		foreach ( $data as $item ){
			list($value, $text) = $callback($item);
			$ret->add($value, $text);
		}
		return $ret;
	}
static public function fromArrayCallback ( array $ data , callable $ callback ) { $ ret = new FormOptions ( ) ; foreach ( $ data as $ item ) { list ( $ value , $ text ) = $ callback ( $ item ) ; $ ret -> add ( $ value , $ text ) ; } return $ ret ; }
Get options from array, applying callback to extract key and value.

fromArrayCallback([$a, $b, $c], function($x){
return [$x->key, $x->value];
});
Get options from array applying callback to extract key and value .