zend framework2 - How to put special tags for each form element? -


मेरे पास फ़ील्ड के साथ फ़ॉर्म है:

  $ this - & gt; जोड़ (सरणी ('नाम' = & gt; 'प्रथम मैदान', 'गुण' = & gt; सरणी ('प्रकार' = & gt; 'पाठ', 'आईडी' = & gt; 'id_firstfield'), 'विकल्प' = & gt; सरणी ('लेबल' = & gt; 'प्रथम मैदान'),)); $ इस - & gt; सरणी ('नाम' = & gt; 'सेकंडफील्ड', 'विशेषताएँ' = & gt; सरणी ('प्रकार' = & gt; 'पाठ', 'आईडी' = & gt; 'id_secondfield'), 'विकल्प' = & gt; जोड़ें ('लेबल' = & gt; 'सेकंडफील्ड'),));   

जब मैं इसका उपयोग करता हूं:

  $ echo-> gt; फ़ॉर्मक्ल्यूशन ($ फॉर्म);   

मेरे विचार में, मुझे मिलता है:

  [...] & lt; लेबल = "id_firstfield" & gt; पहले फ़ील्ड & lt; / label & gt; & Lt; input name = "firstfield" type = "text" id = "id_firstfield" मूल्य = "" & gt; & Lt; लेबल = "id_secondfield" & gt; दूसरा क्षेत्र & lt; / label & gt; & Lt; input name = "secondfield" type = "text" id = "id_secondfield" मान = "" & gt; [...]   

लेकिन मैं चाहता हूं:

  [...] & lt; div id = "divforfirstfield" & gt; & Lt; label = "id_firstfield" & gt; पहले फ़ील्ड & lt; / label & gt; & Lt; input name = "firstfield" type = "text" id = "id_firstfield" मूल्य = "" & gt; & Lt; / div & gt; & Lt; div id = "divforsecondfield" & gt; & Lt; लेबल = "id_secondfield" & gt; दूसरा क्षेत्र & lt; / label & gt; & Lt; input name = "secondfield" type = "text" id = "id_secondfield" मान = "" & gt; & Lt; / div & gt; [...]   

यह कैसे करें?

formCollection () का उपयोग करना यह संभव नहीं है हालांकि आप इसे इस तरह कर सकते हैं:

  & lt; div id = "firstid" & gt; & Lt;? Php echo $ this- & gt; फॉर्मरव ($ form- & gt; प्राप्त करें ('प्रथम फील्ड')); ? & Gt; & Lt; / div & gt; & Lt; div id = "secondid" & gt; & Lt;? Php echo $ this- & gt; formRow ($ form- & gt; प्राप्त करें ('सेकंडफील्ड')); ? & Gt; & Lt; / div & gt;   

यदि आप फॉर्म को रेंडर करने के लिए केवल एक फ़ंक्शन कॉल के आराम प्राप्त करना चाहते हैं, तो आपको एक के साथ formCollection () दृश्य सहायक का विस्तार करना होगा यह स्वयं करते हैं।

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -