Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function testAction() {
- if($this->getParam('flush', 'false') === 'true' || !isset($_SESSION['form'])) {
- $_SESSION['form'] = new Zend_Form();
- $platform = new Zend_Form_SubForm();
- $_SESSION['form']->addSubForm($platform, 'platform');
- $appli = new Zend_Form_SubForm();
- $_SESSION['form']->addSubForm($appli, 'appli');
- $step = new Zend_Form_Element_Text('__step');
- $step->setValue(1);
- $step->setLabel('step');
- $_SESSION['form']->addElement($step);
- $pfname = new Zend_Form_Element_Text('name');
- $pfname->setValue('platform name');
- $pfname->setLabel('platform name');
- $platform->addElement($pfname);
- $applinet = new Zend_Form_SubForm();
- $appli->addSubForm($applinet, 'net');
- $applinetaddr = new Zend_Form_Element_Text('addr');
- $applinetaddr->setLabel('Appli network address');
- $applinetaddr->setValue('localhost');
- $applinet->addElement($applinetaddr);
- }
- $this->view->form = $_SESSION['form'];
- // Process request
- if($this->getRequest()->isPost()) {
- if($this->view->form->isValid($_POST)) {
- $this->view->data = $this->view->form->getValues();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement