Ive had spent many days repeatly on different project, stumbling on one same issue.
AddFilter rename isnt working on my file upload.
It was one simple solution,
first, never ever getValue from the field before addfilter rename is in place.
Its very easy that we miss out lines of code where by it tries to populate data model from form.
Also its also easy to accidentally getting value from model to replace upload form field.
Make sure addfilter rename is called before isvalid is checked.
Hope this will solve your hair pulling days figuring why it isnt working.
The worst part is, Zend Framework isnt complaining about it!
Showing posts with label zendframework. Show all posts
Showing posts with label zendframework. Show all posts
Tuesday, November 20, 2012
Monday, October 1, 2012
a better looking checkbox for zend form element checkbox
Code:
$this->getElement('iagree')->addDecorator('HtmlTag', array('tag' => 'dd', 'class' => 'checkbox'));
$this->getElement('iagree')->addDecorator('Label', array('placement' => 'APPEND', 'class' => 'checkbox', "escape" => false));
//escape to false to prevent from escaping link within the label
//also adding checkbox class to the dd tag and label tag
// and place label to the right of checkbox
Css wise:
dl dd.checkbox {
margin-left: 175px;
float: left;
}
dl label.checkbox {
display: block;
margin-left: 190px;
width: auto;
float: none;
text-align: left;
height: auto;
}
.zend_form label.checkbox.required {
padding-left: 12px;
background-position: left center;
}
$this->getElement('iagree')->addDecorator('HtmlTag', array('tag' => 'dd', 'class' => 'checkbox'));
$this->getElement('iagree')->addDecorator('Label', array('placement' => 'APPEND', 'class' => 'checkbox', "escape" => false));
//escape to false to prevent from escaping link within the label
//also adding checkbox class to the dd tag and label tag
// and place label to the right of checkbox
Css wise:
dl dd.checkbox {
margin-left: 175px;
float: left;
}
dl label.checkbox {
display: block;
margin-left: 190px;
width: auto;
float: none;
text-align: left;
height: auto;
}
.zend_form label.checkbox.required {
padding-left: 12px;
background-position: left center;
}
Subscribe to:
Posts (Atom)