We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Display class Input select help

Development and Programming

Aquarian Web Studio's avatar
Aquarian Web Studio
193 posts
16 years ago
Aquarian Web Studio's avatar Aquarian Web Studio

I am trying to make use of the following code from the docs:

DSP->body .= $DSP->div('itemWrapper')
              .$DSP->qdiv('itemTitle', $LANG->line('category_option'))
              .$DSP->input_select_header('category[]', 'y',8)
              .$DSP->input_select_option('all', $LANG->line('none'))
              .$DSP->input_select_option('none', $LANG->line('none'))
              .$possible_categories
              .$DSP->input_select_footer();

Regarding “.$possible_categories” – how would this variable (array?) have to be set up to work?

Thanks.

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

Caroline, in what context? Are you trying to use this code to work on an extension?

       
Aquarian Web Studio's avatar
Aquarian Web Studio
193 posts
16 years ago
Aquarian Web Studio's avatar Aquarian Web Studio

A module, if the semantics matter. Just trying to add a looped array or string where that $possible_categories bit appears. (Whatever needs to be there, I can make.)

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
16 years ago
Lisa Wess's avatar Lisa Wess

Moved this one down to a more appropriate forum for you. =)

       
Aquarian Web Studio's avatar
Aquarian Web Studio
193 posts
16 years ago
Aquarian Web Studio's avatar Aquarian Web Studio

Awesome, is anyone here able to help?

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
16 years ago
Pascal Kriete's avatar Pascal Kriete

$possible_categories is just an example string (note the . to concatenate the whole thing). In regular usage you would simply add more input_select_options, so you could build it up like this:

$cats = array('a' => 'b', 'c' => 'd');
$possible_categories = '';

foreach($cats as $key => $val)
{
    $possible_categories .= $DSP->input_select_option($key, $val);
}
       
Aquarian Web Studio's avatar
Aquarian Web Studio
193 posts
16 years ago
Aquarian Web Studio's avatar Aquarian Web Studio

Pascal, I could favorite you right now. Thanks for clearing this up.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.