Customizing Zend_Form
Asked Answered
P

4

2

I am dealing with Zend_Form right now and I am having a difficult time figuring out how to:

  1. Use custom images for form buttons and,
  2. Insert text and links in specific places (in my case I want to put a "forgot your password?" link before the submit button).

I've read through the manual but am not seeing anything about this.

Perspire answered 1/12, 2008 at 17:53 Comment(0)
N
3

I think Zend_Form_Decorators may help you: http://framework.zend.com/manual/en/zend.form.decorators.html

Nicolnicola answered 1/12, 2008 at 20:18 Comment(0)
P
3

try to read also this article, I think it is the best one about decorators in Zend_Form

http://devzone.zend.com/article/3450-Decorators-with-Zend_Form

for your usage will be most helpful part about "Full Customization Using the ViewScript Decorator", try to find it in article

Pronghorn answered 12/12, 2008 at 12:36 Comment(0)
A
0

You can write straight up HTML in your view, just make sure that the element names, select options, hidden values etc. correspond to your Zend_Form elements (or set the element decorators to just ViewHelper and use echo $this->form->element where the elements should be). It's just the same POST data anyway when you submit the form. If you're using the form in more than one place, check out the ViewScript decorator.

Armalla answered 1/12, 2008 at 20:43 Comment(1)
This works if I am generating the form directly in the view but what if I am subclassing Zend_Form and then using that to populate a view variable in my controller ($this->view->form = $_getForm)Perspire
H
0
  1. CSS?
  2. You can use an element's setDescription() method to add a description to it. If I remember correctly, this renders into a 'p class="hint"' element, but you can of course change that using the form decorators.
Hibbard answered 1/12, 2008 at 21:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.