utworzyłem sobie prosty formularz w Zend Frameworku, lecz mam problem z wyświetlaniem w nim (w jego textarea'ch) danych pobieranych z MySQL'a.
Mój formularz wygląda następująco:
Kod
<?php
class Application_Form_EditForm extends Zend_Form
{
public function init() {
$this->autor = new Zend_Form_Element_Text('autor');
$this->autor->setLabel('Autor: ')
->setRequired(true);
$this->tytul = new Zend_Form_Element_Text('tytul');
$this->tytul->setLabel('Tytul: ')
->setRequired(true);
$this->tresc = new Zend_Form_Element_Textarea('tresc');
$this->tresc->setLabel('Tresc: ')
->setRequired(true)
->setAttrib('cols', '40')
->setAttrib('rows', '15');
$this->wyslij = new Zend_Form_Element_Submit('wyslij');
$this->wyslij->setLabel('Dodaj newsa');
$this->addElements(array($this->autor, $this->tytul, $this->tresc, $this->wyslij));
$this->setMethod('post');
$this->setAction('../index/news-edit');
}
}
class Application_Form_EditForm extends Zend_Form
{
public function init() {
$this->autor = new Zend_Form_Element_Text('autor');
$this->autor->setLabel('Autor: ')
->setRequired(true);
$this->tytul = new Zend_Form_Element_Text('tytul');
$this->tytul->setLabel('Tytul: ')
->setRequired(true);
$this->tresc = new Zend_Form_Element_Textarea('tresc');
$this->tresc->setLabel('Tresc: ')
->setRequired(true)
->setAttrib('cols', '40')
->setAttrib('rows', '15');
$this->wyslij = new Zend_Form_Element_Submit('wyslij');
$this->wyslij->setLabel('Dodaj newsa');
$this->addElements(array($this->autor, $this->tytul, $this->tresc, $this->wyslij));
$this->setMethod('post');
$this->setAction('../index/news-edit');
}
}
Czyli prosty zwyczajny formularz - proszę o pomoc jak mogę pobrane dane z MySQL ustawić jako wyświetlanie w tym formularzu?
Pozdrawiam!