zend-decorators

Is there a better way of designing zend_forms rather than using decorators?

℡╲_俬逩灬. 提交于 2020-01-15 03:01:12
问题 I am currently using zend_decorators to add styles to my form. I was wondering if there is an alternative way of doing it? It is a bit difficult to write decorators. I would love the casual one using divs and css style : <input type="submit" class="colorfulButton" > It is much simpler rather than set a decorator for a certain control and add it. Since it requires creating a decorator for each style implementation and adding it up with the control. Will view helpers to the trick? 回答1: There's

Override Separator on Zend_Form Radio Elements When Using a ViewScript Decorator

安稳与你 提交于 2019-12-21 23:57:25
问题 I am using ViewScripts to decorate my form elements. With radio elements, the separator can normally be overridden, but the override is being ignored when I use the ViewScript. When I use the below call and ViewScript, the radio elements are separated by a '<br />' rather than the space I've specified. If leave the default decorators, the override works. $this->addElement('radio', 'active', array( 'disableLoadDefaultDecorators' => true, 'decorators' => array(array('ViewScript', array(

Use zend-decorator to format Zend_Form_Element_Radio in a table column with oher Zend_Form_Elements in rows

余生颓废 提交于 2019-12-20 01:46:05
问题 I want use decorators to format as table the following Zend_Form, placing a description in the first column and the Zend_Form_Element_Radio's options in second column and add 2 select in every row as you can see in the html example later. I need a concrete/working example. FORM class My_Form extends Zend_Form { const KIND_1 = 'dineer1'; const KIND_2 = 'dineer2'; const KIND_3 = 'dineer3'; const KIND_4 = 'dineer4'; const KIND_5 = 'dineer5'; const KIND_6 = 'dineer6'; public static $KINDS = array

Zend Framework: How do I remove the decorators on a Zend Form Hidden Element?

六眼飞鱼酱① 提交于 2019-12-18 10:03:10
问题 I'm trying to remove the default decorators on a hidden form element. By default, the hidden element is displayed like this: <dt>Hidden Element Label (if I had set one)</dt> <dd><input type="hidden" name="foobar" value="1" id="foobar"></dd> I don't want my hidden element to take up space on my page. I want to remove all the default decorators so all I'm left with is the input tag. <input type="hidden" name="foobar" value="1" id="foobar"> How can I achieve this? 回答1: For hidden field you need

Zend Form captcha Decorator

守給你的承諾、 提交于 2019-12-11 04:49:59
问题 Zend Captcha generates 3 elements together are captcha image, hidden input element, input text box for captcha code respectively and places them side by side without any separator. I want to decorate captcha image tag only in captcha element being generated by zend form captcha. And leave input elements intact. I don't want to create custom decorator class for it. Is there any way to do this? I delve into zend decorator where I see $_separator variable. Can it be helpful? Please help. 回答1:

Zend framework form Decorators

夙愿已清 提交于 2019-12-10 11:09:22
问题 i am trying to get the following layout using decorators: <form action="/index/login" method="post" id="login_form"> <div class="input_row"> <img src="/images/user_icon.png" class="login_icon" alt=""/> <label for="username" class="login_label">Username:</label> <input type="text" name="username" value="" id="username" class="login_input" /> </div> <div class="input_row"> <img src="/images/password_icon.png" class="login_icon" alt=""/> <label for="password" class="login_label">Password:</label

Zend_Form_Decorator - How to add attrib to Zend_Form_Element_Hidden?

不羁的心 提交于 2019-12-06 14:54:32
问题 I have 2 requirements: 1) All hidden input elements should be affected without removing standard decorators. 2) This should happen WITHOUT having to specify it on a per-element basis. All I need is for a CSS class to be attached to the DT & DD tags IF the element type is Zend_Form_Element_Hidden. I've tried creating custom HtmlTag, DtDdWrapper, and FormElement decorators, but haven't been able to figure out how to do it. By default they appear this way: <dt> </dt> <dd><input type="hidden"

Zend_Form_Decorator - How to add attrib to Zend_Form_Element_Hidden?

我的未来我决定 提交于 2019-12-04 20:45:35
I have 2 requirements: 1) All hidden input elements should be affected without removing standard decorators. 2) This should happen WITHOUT having to specify it on a per-element basis. All I need is for a CSS class to be attached to the DT & DD tags IF the element type is Zend_Form_Element_Hidden. I've tried creating custom HtmlTag, DtDdWrapper, and FormElement decorators, but haven't been able to figure out how to do it. By default they appear this way: <dt> </dt> <dd><input type="hidden" name="whatever" value="bling" /></dd> I would like them to appear this way: <dt class="hidden"> </dt> <dd

Override Separator on Zend_Form Radio Elements When Using a ViewScript Decorator

余生颓废 提交于 2019-12-04 19:39:30
I am using ViewScripts to decorate my form elements. With radio elements, the separator can normally be overridden, but the override is being ignored when I use the ViewScript. When I use the below call and ViewScript, the radio elements are separated by a '<br />' rather than the space I've specified. If leave the default decorators, the override works. $this->addElement('radio', 'active', array( 'disableLoadDefaultDecorators' => true, 'decorators' => array(array('ViewScript', array('viewScript' => 'form/multi.phtml'))), 'label' => 'Active', 'required' => true, 'multiOptions' => array('1' =>

Zend Framework Checkbox Decorators

試著忘記壹切 提交于 2019-12-03 13:00:17
问题 What I am trying to accomplish is to have checkbox labels display after checkbox input fields (to the right of them). I am using these decorators now: private $checkboxDecorators = array( Label, array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'checkbox')), 'ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'li')), ); I have tried switching the Label and ViewHelper decorators but that did nothing. Any suggestions? 回答1: $this->getElement('elementId')->addDecorator(