porting template to zend framework -


I have some problems using a pay-based form to zip the form.

  • Currents
  • Things I've Used To be presented as a pear. I can not explicitly use pre-existing decoration because I need to specify the CSS class for each component of my basic elements. To see this issue I have to present it, which is a template for a basic element:

       

    So you can see that I have many dynamic things that I would like to be able to specify: the status in the form, the class for the label, the class for the required section, for the square Error. I would like to be able to specify it from an ini file. I manage to set the original meta from ini, but not the custom field.

    One reason I can not use the original decor is that I need to have an "error" in the "li" class element or an error in subtype I'm not sure that this error is possible with decorator ... (correct me if I'm wrong)

    Besides, for the group I need to deal with some errors, and since the main group Do not handle errors, I need sub-base sub-class but how can I make a subform in the INI file and I do not know how to provide the parameter to the subforms of INI.

    Here the main idea is to form a 'name' group with an absolute name, middle name etc. for example, in a form of visual and logic group elements. Along with that, a global verifier for this "name" group also means the second thing is that I want to be able to position these groups: left half, right half, full, I have been prepared CSS for this and pears Had to work with.

    So what I want is a simple solution, with some code and eye configuration, unfortunately, I feel trapped in some complex, so if anyone has any information about a simple architecture So it would be amazing!

    Thank you for your help, Best, Boris

    Your complex decoration requirement In, you are the Zend_Form_Alment_Accelerator

      $ element-> SetDecorators (array (array ('viewcript', array ('visible script' = 'gtc:' path / in / your / view / element.phtml ')),););  

    and then in path / in / your / thoughts / element.phtml , more or less something

      & lt; Li class = "& lt ;? php echo $ this-> element-> getAttrib ('position_in_the_form')? & Gt; & lt ;? php echo $ this-> element- & gt; heres )? 'Error': ''? & Gt; "& gt; & Lt; Label class = "& lt ;? php echo $ this-> element-> getAttrib ('label_class')? & Gt; & Gt; & Lt ;? Php echo $ this- & gt; Form label ($ this-> element-> getName (), $ this-> element- & gt; matchable ())? & Gt; By & lt;? If ($ this-> element-> is undefined ()) {? & Gt; [& Lt; Span class = "required class" & gt; * & Lt; / Span & gt;] & lt;? }? & Gt; & Lt; / Labels & gt; & Lt; Div & gt; & Lt ;? Php ek $ this- & gt; {$ This- & gt; Element- & gt; Helper} ($ this-> element-> getName (), $ this-> element-> getValue (), $ it-> element-> millwork ())? & Gt; & Lt; / Div & gt; By & lt;? If ($ this-> element-> is error ()) {? & Gt; [& Lt; P class = "& lt ;? php echo $ this-> element-> GetAttrib ('error_class')? & Gt; & Gt; & Lt ;? Php echo $ this- & gt; Form errors ($ this-> element-> getMessages ())? & Gt; & Lt; / P & gt;] & lt; }? & Gt; & Lt; / Li & gt;  

    This is only a draft snippet of code , but you should move in the direction of your goal.

    Regards


    Comments

    Popular posts from this blog

    MySql variables and php -

    url rewriting - How to implement the returnurl like SO in PHP? -

    Which Python client library should I use for CouchdB? -