本文整理匯總了PHP中Zend_Form::addSubform方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Form::addSubform方法的具體用法?PHP Zend_Form::addSubform怎麽用?PHP Zend_Form::addSubform使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Form
的用法示例。
在下文中一共展示了Zend_Form::addSubform方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAutoForm
protected function getAutoForm($formType = 'main_entity')
{
if ($this->autoForm == null) {
$id = $this->getOperationalEntityId();
$action = "/admin/{$this->controllerName}/edit/" . ($id ? "id/{$id}" : '');
$form = new Zend_Form(array('action' => $action, 'method' => 'post'));
// Build AutoCrud
$autoForm = new Awe_Form_AutoMagic($formType, $this->doctrineColumns, $this->getOperationalEntity());
$form->addSubform($autoForm, 'awe_form');
$this->autoForm = $form;
}
return $this->autoForm;
}
示例2: testMultiFileWithOneFile
public function testMultiFileWithOneFile()
{
$form = new Zend_Form();
$element = new Zend_Form_Element_File('file');
$element->setMultiFile(1);
$subform0 = new Zend_Form_SubForm();
$subform0->addElement($element);
$subform1 = new Zend_Form_SubForm();
$subform1->addSubform($subform0, 'subform0');
$subform2 = new Zend_Form_SubForm();
$subform2->addSubform($subform1, 'subform1');
$subform3 = new Zend_Form_SubForm();
$subform3->addSubform($subform2, 'subform2');
$form->addSubform($subform3, 'subform3');
$form->setView(new Zend_View());
$output = (string) $form;
$this->assertNotContains('name="file[]"', $output);
}
示例3: testMultiFileInSubSubSubform
public function testMultiFileInSubSubSubform()
{
$form = new Zend_Form();
$element = new Zend_Form_Element_File('file');
$element->setMultiFile(2);
$subform0 = new Zend_Form_SubForm();
$subform0->addElement($element);
$subform1 = new Zend_Form_SubForm();
$subform1->addSubform($subform0, 'subform0');
$subform2 = new Zend_Form_SubForm();
$subform2->addSubform($subform1, 'subform1');
$subform3 = new Zend_Form_SubForm();
$subform3->addSubform($subform2, 'subform2');
$form->addSubform($subform3, 'subform3');
$form->setView(new Zend_View());
$output = (string) $form;
$this->assertContains('name="file[]"', $output);
$this->assertEquals(2, substr_count($output, 'file[]'));
}