2011-01-21 6 views
3

2つの要素選択と複数チェックボックスを定義するXml configを使用してZend_Formを作成しています。私はこの質問を回答したlinkを見つけましたが、multicheckbox要素構文の例は見つかりませんでした。zendフォームの<multicheckbox>フォーム要素を定義するための適切なXML構文は何ですか?

ご了承ください。ここ

iが(楽しみのために)これまでに行ったことある

<?xml version="1.0" encoding="UTF-8"?> 
<form> 
    <localhost> 
     <formmanager> 
      <pizza> 
       <action>/form/</action> 
       <method>post</method> 
       <name>Pizza</name> 
       <elements> 
        <crust> 
         <type>Select</type> 
         <name>crust</name> 

         <options> 
          <label>Crust:</label> 
          <required>true</required> 
          <multioptions> 
           <option value="Thin crust">Thin crust</option> 
           <option value="Thick crust">Thick crust</option> 
          </multioptions> 
         </options> 
        </crust> 
        <pan> 
         <type>MultiCheckbox</type> 
         <required>true</required> 
         <options> 
          <label>Pan:</label> 
          <multioptions> 
           <option>American Hot</option> 
           <option>Cheese and tomato</option> 
          </multioptions> 
         </options> 
        </pan> 
       </elements> 
      </pizza> 
     </formmanager> 
    </localhost> 
</form> 

答えて

4

ソリューション:長い時間の後、のZend_Config、Zend_Config_Xmlなど、Zend_Form_Element_MultiChoiceBoxとクラスZend_Form_Element_Multiを見て、私はそれを考え出したし、ここにis

<?xml version="1.0" encoding="UTF-8"?> 
<form> 
    <localhost> 
     <formmanager> 
      <pizza> 
       <action>/form/</action>   
       <method>post</method>   
       <name>Pizza</name>    
       <elements> 
        <crust> 
         <type>Select</type>    
         <name>crust</name>    
         <options>      
          <label>Crust:</label>   
          <required>true</required>  
          <multioptions>     
           <thin_crust>Thin Crust</thin_crust> 
           <thick_crust>Thick Crust</thick_crust> 
          </multioptions>     
          <value>test</value>    
         </options>      
        </crust> 
        <pan> 
         <type>MultiCheckbox</type>  
         <name>pan</name>     
         <options>      
          <label>Pan:</label>    
          <multioptions>     
           <american>American Hot</american> 
           <cheese>Cheese and Tomato</cheese> 
          </multioptions>     
          <required>true</required>  
         </options>      
        </pan> 
       </elements> 
      </pizza> 
     </formmanager> 
    </localhost> 
</form> 
関連する問題