Corey
Corey

Reputation: 1977

Handling n text elements in a zend form

I have an order form that extends Zend_form:

class Form_Order extends Zend_Form
{
    public function __construct($options = null)
    {
        parent::__construct($options);

        ...

Each order can have any number of products. What's the best way to pass in a list of products to repopulate the form? Just add a "values = array()" after "options"?

Bonus! How do I validate it?

Upvotes: 0

Views: 57

Answers (1)

KomarSerjio
KomarSerjio

Reputation: 2911

Yes. Or you can add setter method $form->setProducts($products)

Upvotes: 1

Related Questions