Re: RE: HTML_Select
| From: | Jon Wood | Date: | Mon, 14 Oct 2002 17:59:47 +0000 |
| Subject: | Re: RE: HTML_Select | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-10065@lists.php.net to get a copy of this message | ||
Since I've got to much free time on my hands, and nothing to do with it, I'm
willing to try building something like that - I'll take a look at it
tonight, and see what I can do.
Jon
----- Original Message -----
From: "Stowe, Nola" <NStowe@TheTTGroup.com>
To: "'Richard Heyes'" <richard@phpguru.org>; "PEAR Dev"
<pear-dev@lists.php.net>
Sent: Tuesday, October 15, 2002 3:21 PM
Subject: [PEAR-DEV] RE: HTML_Select
> Good idea. However, I would like there to be a method:
>
> HTML_Select->setChooseText("Choose:");
>
> with the default being what you have "Choose a country:"
>
>
> Actually, I would like to see part of the eXtremePHP library implemented
> here. You can view the library at http://www.extremephp.org
> every HTML
tag
> is extended from HtmlTag, which has the methods addParameter(name, value)
> and setParameter(name, value) ... set changes the current parameter.
Having
> a base class is very handy for all sorts of HTML objects. Not you would
make
> every html code in your page with the library, but I can see it handy for
> pre-built objects such as select lists, menus, etc.
>
> > -----Original Message-----
> > From: Richard Heyes [SMTP:richard@phpguru.org]
> > Sent: Sunday, October 13, 2002 8:15 AM
> > To: PEAR Dev
> > Subject: HTML_Select
> >
> > Hi,
> >
> > Been playing around making some common select dropdown code and came up
> > with
> > the following
> > package idea:
> >
> > HTML
> > |
> > +-Select
> > |
> > +-Country.php
> > +-USStates.php
> > +-UKCounties.php
> >
> > Some sample code for the country script:
> >
> > require_once('I18N/Country.php');
> >
> > class HTML_Select_Country extends I18N_Country
> > {
> > function getDropDown($name, $selectedOption = null)
> > {
> > $options[] = '<option value="">Select a
country...</option>';
> > $selectedOption = strtolower($selectedOption);
> >
> > foreach ($this->_codes as $code => $country) {
> > $code = strtolower($code);
> > $selected = $selectedOption == $code ? '
selected="selected"'
> > :
> > '';
> > $options[] = '<option value="' . $code . '"'
> > . $selected .
'>'
> > .
> > ucfirst(strtolower($country)) . '</option>';
> > }
> >
> > return sprintf('<select name="%s">%s</select>',
> > $name,
> > implode("\r\n", $options));
> > }
> > }
> >
> > Thoughts ?
> >
> > --
> > Richard Heyes
> > V-webmail - http://www.v-webmail.co.uk
> >
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>