I am currently trying to build a simple custom layer that I will extend instead of Zend_Form. For instance, My_Form.
I want all my forms to look the same so I am setting this in My_Form. Here is what it is so far.
class My_Form extends Zend_Form
{
protected $_elementDecorators = array(
'ViewHelper',
'Errors',
...
Is there a way I can get my the following function ported correctly to the the Zend_Form_Element? I have a custom element and i am passing my own options in for the details of what I am working on: below is the PHP and following will be the INI
$html = $this->helper->formBlah(array(
'name'=>'foo',
'value...
I am having issues with zend_form and zend_decorator.
I have created a decorator class to default all forms to use list elements, however it doesn't seem to be working!
Essentially my_decorator_design extends zend_form and then my forms extend the decorator.
Ideas?
class My_Decorator_Design extends Zend_Form {
public function load...
Hi everyone,
I'm new to zend framework but have made my first steps with it successfully.
Until now I have created some Zend_Forms which are mapping single records of my model
to the form fields. I have handled the forms with form classes for each case.
This works all very well until now.
Now I have the situation that I have to asign...
I was wondering if is there an easy way to generate views from form objects when dealing with CRUDs.
I mean, when we have these options: VIEW | EDIT | DELETE
I want my VIEW option like EDIT option, but without form elements, just the values.
This will minimize so much the time spent to create these views.
Someone knowks something like...
I am populating a Select form element, and if I try to use HTML Entities in the value, it get's converted, rather than displaying the special character.
This code:
$form->field_name->addMultiOption('value', ' • label');
Renders:
<option value="one">&nbsp;&bull; label</option>
But I want it to be:
<option value="...
I am trying to get custom error message to work for MultiCheckbox, doesn't work. It is the same way I did for Zend_Form_Element_Text that works.
But for MultiCheckbox, nothing. I tried different combinations but the message "Invalid type given, value should be float, string, or integer" doesn't go away.
Here is the code below. Any help...
hello
i created a form that it decorates as table form
its my code for decorates
$this->setElementDecorators(array(
'ViewHelper',
'Errors'
array(array('data'=>'HtmlTag'),
array('tag'=>'td','class'=>'element')),
array('Label',array('tag'=>'td')),
array(array('row'...
Despite many trials and errors, I cannot get the NumberTextBox widget to work. I keep receiving this error message:
Catchable fatal error: Argument 4 passed to Zend_Dojo_View_Helper_NumberTextBox::numberTextBox() must be an array, null given
The odd thing is: I event tried this example straight from the ZF examples page and it fail...
How do I unit-test a Zend_Form form class I wrote for my application?
I aspire to have a 100% code coverage, so just testing each controller that uses it, doesn't seem enough, but I could be missing something in the UnitTest approach..
...
<select name="day" id="day">
<option value="0" label="Day:">Day:</option>
<option value="1" label="1">1</option>
</select>
<select name="month" id="month">
<option value="0" label="Month:">Month:</option>
<option value="1" label="January">January</option>
</select>
<select name="year" id="year">
<opt...
I have set the form decorators in this way:
<?php
$this->setElementDecorators(array(
'Label',
array(array('labelTd' => 'HtmlTag'), array('tag' => 'td', 'class' => 'name')),
array(array('elemTdOpen' => 'HtmlTag'), array('tag' => 'td', 'class' => 'form','openOnly' => true, 'placement' => '...
I am experimenting with uploading files in a Zend_Form using the Zend_Form_Element_File doing something like this in my form so that the actual upload can be handled by my controller (which in my case is to eventually do some custom file re-naming on the fly).
$element = new Zend_Form_Element_File('Upload');
$element->setDestination(U...
hii i am new to zend . i have written a form using zend . like under forms i have created the forms and a simple one like
$specific_consultant = new Zend_Form_Element_Radio('Specific_consultant');
$specific_consultant->setLabel('Specific Consultant')
->addMultiOptions(array(
'Yes' => 'Yes',
...
I'm trying to add a plain text node in a zend form - the purpose is to only dispay some static text.
The problem is - im not aware of any such way to do it.
I have used 'description' but that HAS to be attached to a form element.
Is there any way to simply display some text as part of a form? Zend considers everything as a form eleme...
Here's what I'd like:
Here's my code:
<?php
require_once ('Zend\Form.php');
class Sergio_Form_registrationform extends Zend_Form {
public function init(){
/*********************USERNAME**********************/
$username = new Zend_Form_Element_Text('username');
$alnumValidator = new Zend_Validate_Aln...
Hi all,
Update I was able to get this to work by creating a custom Label decorator, which extended Zend/Form/Decorator/Label.php. I added a setTagClass() method to it and overrode the render method to create the enclosing tag with the desired class. There might be a more elegant way to do it but this seems to work.
I'm looking for in...
How to make jQuery slider with fixed maximum ... exact like this:
http://jqueryui.com/demos/slider/#rangemin
I manage to do it half way:
$slider = new ZendX_JQuery_Form_Element_Slider('amount');
$slider->setLabel('Set Amount: ');
$slider->setJQueryParams(array('min' => 0, 'max' => 60, 'value' => 15));
I don't know how to display the...
I add this class to library/My/Validate/PasswordConfirmation.php
<?php
require_once 'Zend/Validate/Abstract.php';
class My_Validate_PasswordConfirmation extends Zend_Validate_Abstract
{
const NOT_MATCH = 'notMatch';
protected $_messageTemplates = array(
self::NOT_MATCH => 'Password confirmation does not match'
);
...
How subforms created in zend?
Please explain with an example.
...