rg88
rg88

Reputation: 20977

Customizing Zend_Form

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.

Upvotes: 2

Views: 884

Answers (4)

Martin Rázus
Martin Rázus

Reputation: 4705

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

Upvotes: 3

bertbalcaen
bertbalcaen

Reputation: 156

  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.

Upvotes: 0

monzee
monzee

Reputation: 423

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.

Upvotes: 0

Irmantas
Irmantas

Reputation:

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

Upvotes: 3

Related Questions