Quantcast

how to define <option> in a config.ini

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

how to define <option> in a config.ini

Mike Wright
Hi all!

I have an app with forms and subforms, all defined in .ini configs.

Now that it's fleshed out I want to turn some <input> tags into <select>
tags (easy peasy), but how do I declare

         <option value="myValue">Description</option>

with config.ini format?

Any takers?

Thanks for a great framework,
Mike Wright

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how to define <option> in a config.ini

Konr Ness
Try this:

        myForm.elements.mySelect.type = "select"
        myForm.elements.mySelect.options.multiOptions.myValueOne = "My
Description One"
        myForm.elements.mySelect.options.multiOptions.myValueTwo = "My
Description Two"

Konr

On Mon, Oct 24, 2011 at 2:28 PM, Mike Wright <[hidden email]> wrote:

>
> Hi all!
>
> I have an app with forms and subforms, all defined in .ini configs.
>
> Now that it's fleshed out I want to turn some <input> tags into <select> tags (easy peasy), but how do I declare
>
>        <option value="myValue">Description</option>
>
> with config.ini format?
>
> Any takers?
>
> Thanks for a great framework,
> Mike Wright
>
> --
> List: [hidden email]
> Info: http://framework.zend.com/archives
> Unsubscribe: [hidden email]
>
>

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how to define <option> in a config.ini

weierophinney
Administrator
In reply to this post by Mike Wright
-- Mike Wright <[hidden email]> wrote
(on Monday, 24 October 2011, 12:28 PM -0700):
> I have an app with forms and subforms, all defined in .ini configs.
>
> Now that it's fleshed out I want to turn some <input> tags into
> <select> tags (easy peasy), but how do I declare
>
>         <option value="myValue">Description</option>
>
> with config.ini format?

elementName.options.options.myValue = "Description"

Yes, two "options" in there -- the first is indicating the form
element's general configuration options, the second the "options" to use
in the select tag.

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how to define <option> in a config.ini

Mike Wright
On 10/24/2011 02:05 PM, Matthew Weier O'Phinney wrote:

> -- Mike Wright<[hidden email]>  wrote
> (on Monday, 24 October 2011, 12:28 PM -0700):
>> I have an app with forms and subforms, all defined in .ini configs.
>>
>> Now that it's fleshed out I want to turn some<input>  tags into
>> <select>  tags (easy peasy), but how do I declare
>>
>>          <option value="myValue">Description</option>
>>
>> with config.ini format?
>
> elementName.options.options.myValue = "Description"
>
> Yes, two "options" in there -- the first is indicating the form
> element's general configuration options, the second the "options" to use
> in the select tag.
>

Thanks @Konr @MWO'P

I'd say I'm losing my mind but that's been a given for years ;)

I can't make this work.  There are never any <option />

Here is the simple config.ini file.

[test]
id = "test"
class = "test"
order = "20"
legend = "Testing"

elements.fest.type = "select"
elements.fest.options.label = "Who"
elements.fest.options.options.me = "Me"
elements.fest.options.options.ye = "Ye"

elements.zest.type = "text"
elements.zest.options.label = "Text Box"
elements.zest.options.value = "tea"

elements.jest.type = "textarea"
elements.jest.options.label = "Textarea Box"
elements.jest.options.value = "coffee"

This displays beautifully except that the <select /> is always empty.

It's not a css issue.  Using Firebug I see the response doesn't contain
any <option /> elements.

Using fedora's package of 1.11.  Haven't overridden any view helpers.

Fresh eyes, anybody?

Thanks again,
Mike Wright

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how to define <option> in a config.ini

Konr Ness
It does have to be multiOptions, as the second config key, not options.

The following modified config file worked fine for me:

[test]
id = "test"
class = "test"
order = "20"
legend = "Testing"

elements.fest.type = "select"
elements.fest.options.label = "Who"
elements.fest.options.multiOptions.me = "Me"
elements.fest.options.multiOptions.ye = "Ye"

elements.zest.type = "text"
elements.zest.options.label = "Text Box"
elements.zest.options.value = "tea"

elements.jest.type = "textarea"
elements.jest.options.label = "Textarea Box"
elements.jest.options.value = "coffee"


Konr

On Tue, Oct 25, 2011 at 4:17 PM, Mike Wright <[hidden email]> wrote:

> On 10/24/2011 02:05 PM, Matthew Weier O'Phinney wrote:
>>
>> -- Mike Wright<[hidden email]>  wrote
>> (on Monday, 24 October 2011, 12:28 PM -0700):
>>>
>>> I have an app with forms and subforms, all defined in .ini configs.
>>>
>>> Now that it's fleshed out I want to turn some<input>  tags into
>>> <select>  tags (easy peasy), but how do I declare
>>>
>>>         <option value="myValue">Description</option>
>>>
>>> with config.ini format?
>>
>> elementName.options.options.myValue = "Description"
>>
>> Yes, two "options" in there -- the first is indicating the form
>> element's general configuration options, the second the "options" to use
>> in the select tag.
>>
>
> Thanks @Konr @MWO'P
>
> I'd say I'm losing my mind but that's been a given for years ;)
>
> I can't make this work.  There are never any <option />
>
> Here is the simple config.ini file.
>
> [test]
> id = "test"
> class = "test"
> order = "20"
> legend = "Testing"
>
> elements.fest.type = "select"
> elements.fest.options.label = "Who"
> elements.fest.options.options.me = "Me"
> elements.fest.options.options.ye = "Ye"
>
> elements.zest.type = "text"
> elements.zest.options.label = "Text Box"
> elements.zest.options.value = "tea"
>
> elements.jest.type = "textarea"
> elements.jest.options.label = "Textarea Box"
> elements.jest.options.value = "coffee"
>
> This displays beautifully except that the <select /> is always empty.
>
> It's not a css issue.  Using Firebug I see the response doesn't contain any
> <option /> elements.
>
> Using fedora's package of 1.11.  Haven't overridden any view helpers.
>
> Fresh eyes, anybody?
>
> Thanks again,
> Mike Wright
>
> --
> List: [hidden email]
> Info: http://framework.zend.com/archives
> Unsubscribe: [hidden email]
>
>
>

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how to define <option> in a config.ini

Mike Wright
On 10/25/2011 02:43 PM, Konr Ness wrote:

> It does have to be multiOptions, as the second config key, not options.
>
> The following modified config file worked fine for me:
>
> [test]
> id = "test"
> class = "test"
> order = "20"
> legend = "Testing"
>
> elements.fest.type = "select"
> elements.fest.options.label = "Who"
> elements.fest.options.multiOptions.me = "Me"
> elements.fest.options.multiOptions.ye = "Ye"

Excellent.  Works here, too ;)

Now, on to radio and checkbox...

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Loading...