Posts Tagged ‘Zend Framework’

Zend_Form with Zend_Validate with Zend_File_Transfer

How to build form using ini files.
Example includes Zend_Form elements, Zend_Validate and File uploads using Zend_File_Transfer.
Protected method to retrieve form config and fill data into selectbox.
protected function prepareProductForm()
{
$form = new Application_Form( ‘admin/product’ );
$categories = array( ‘Select Category’ );
foreach( Application_Category::getCategories() as $category )
{
$categories[$category->categoryId] = $category->name;
}
$form->getElement( ‘categoryId’ )->setMultiOptions( $categories );
return $form;
}
This method will render form from and [...]