I am trying to create HTML archive for color input fields .. which will be dynamically added using Javascript
My and added it to the form and in my view file .. This print output like It is supposed to be printed in. I hope the HTML input name is In the above case. I only get a color name in Why not print zf2 Oh finally answered me I have to call It works now before render anything in the scene ColorFieldset is the code
namespace dashboard \ form; Use Zend \ Form \ Fieldset; Use Zend \ InputFilter \ InputFilterProviderInterface; The Square ColorFieldset field sets the InputFilterProviderInterface {public function __construct () {origin: __ creation ('color'); $ (This' & gt; array ('name' = & gt; 'hash', 'option' => array ('label' = & gt; 'color'), 'attribute' => array ( 'Required' & gt; 'expected', 'class' = & gt; 'input-mini'))); } / ** * Return Array \ * / Public Function getInputFilterSpecification () {Return Array ('hash' = & gt; array ('required' => is true)); }}
$ this-> Addition (array ('type' = & gt; 'jend' \ form \ element \ 'archive', 'name' = & gt; 'color', 'option' => array ('count' = & gt; 2 , 'Should_create_template' = & gt; true, 'allow_add' = & gt; true, 'target_element' = & gt; array ('type' = & gt; 'dashboard' form \ colorful set ''))));
colors.phtml
& lt; Div id = "colors_container" class = "" & gt; & Lt ;? Php ek $ this- & gt; Form Clalling ($ form- & gt; Mill ('Color')); ? & Gt; & Lt; / Div & gt;
& div; Div class = "" id = "colors_container" & gt; & Lt; Label & gt; & Lt; Span & gt; Color & lt; / Span & gt; & Lt; Input type = "text" value = "class =" input-mini "required =" required "name =" hash "& gt; & Lt; / Label & gt; & Lt; Label & gt; & Lt; Span & gt; Color & lt; / Span & gt; & Lt; Input type = "text" value = "class =" input-mini "required =" required "name =" hash "& gt; & Lt; / Label & gt; & Lt; Span data-templates = '& lt; Label & gt; & Lt; Span & gt; Color & lt; / Span & gt; & Lt; Input name = "hash" required = "required" class = "input-mini" type = "text" value = "" & gt; & Lt; / Labels & gt; '& Gt; & Lt; / Span & gt; & Lt; / Div & gt;
& lt; Div class = "" id = "colors_container" & gt; & Lt; Label & gt; & Lt; Span & gt; Color & lt; / Span & gt; & Lt; Input type = "text" value = "" class = "input-mini" required = "required" name = "color [0] [hash]" & gt; & Lt; / Labels & gt; & Lt; Label & gt; & Lt; Span & gt; Color & lt; / Span & gt; & Lt; Input type = "text" value = "" class = "input-mini" required = "required" name = "color [1] [hash]" & gt; & Lt; / Labels & gt; & Lt; Span data-templates = '& lt; Label & gt; & Lt; Span & gt; Color & lt; / Span & gt; & Lt; Input name = "color [__ index __] [hash]" required = "required" class = "input-mini" type = "text" value = "" & gt; & Lt; / Labels & gt; '& Gt; & Lt; / Span & gt; & Lt; / Div & gt;
color [__ index __] [hash] . But this print name is
& lt; Input type = "text" value = "" class = "input-mini" required = "required" name = "hash" & gt; .
& lt; Input type = "text" value = "" class = "input-mini" required = "required" name = "color [0] [hash]" & gt; ? Please advise what is wrong with my code.
$ Form- & gt; ready ();
No comments:
Post a Comment