AC
Erro ao carregar um form
Fechado
Ao carregar o meu form estou recebendo o seguinte erro:
Warning: Invalid argument supplied for foreach() in C:EasyPHP-DevServer-13.1VC9datalocalwebCalcfer_AdiantilibadiantiwidgetwebformTForm.class.php on line 188
Utilizei o seguinte código:
Como resolver este problema?
Warning: Invalid argument supplied for foreach() in C:EasyPHP-DevServer-13.1VC9datalocalwebCalcfer_AdiantilibadiantiwidgetwebformTForm.class.php on line 188
Utilizei o seguinte código:
- <?php
- class gerapedido extends TPage{
- private $form;
- function __construct(){
- parent::__construct();
- $this->form = new TForm('pedido_form');
- try {
- $ui = new TUIBuilder(1100,600);
- $ui->setController($this);
- $ui->setForm($this->form);
- $ui->parseFile('app/forms/ColunasVigas.form.xml');
- $this->form->add($ui);
- $this->form->setFields($ui->getFields);
- } catch (Exception $e) {
- new TMessage('error',$e->getMessage());
- }
- parent::add($this->form);
- }
- }
- ?>
Como resolver este problema?
Alessandra,
getFields() é um método, não um atributo, assim você deve usar parêntesis nele...:
$this->form->setFields($ui->getFields());
abs,
Pablo