<SELECT NAME="name">

<SELECT NAME="name"> – creates PHP variable and code for select lists

Synopsis

Usage ( <SELECT NAME="name"> )

Description

fills in the select values based on the form name and the tag name and adds code to check if the object variable matches them. If flexyignore is used, it is left alone. If static is set, the currently defined options will be used.

Example

Using an element to change a template.

<?php
$form 
= new HTML_Template_Flexy();
$form->compile('some_file_name');

// create an instance (note you dont have to specify any details..)
 
// select options
$elements['test_select'] = new HTML_Template_Flexy_Element;
$elements['test_select']->setOptions( array(
  
'123' => 'a select option',
  
'1234' => 'another select option'
));
$elements['test_select']->setValue('1234');

 
$form->outputObject(new StdClass$elements);

// in the example below, the new data you have added is to the existing attributes
?>

template example

         
<BODY>
  <FORM name="theform" flexy:ignoreonly="yes">
       <SELECT name="test_select"></SELECT>
   
    
  </FORM>
</BODY>

compiled template

<BODY>
  <FORM name="theform">
  
    <?php echo $this->elements['test_select']->toHtml();?>
    
    
  </FORM>
</BODY>

output from the Template

         
<BODY>
  <FORM name="theform">
  
    
    <SELECT name="test_select">
      <option value="123">a selection option</option>
      <option value="1234" selected>another selection option</option>
      
    </SELECT>
    
  </FORM>
</BODY>
creates PHP variable for textarea value (Previous) creates a PHP if conditional tag (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.