At First my Class
-----------------------------------------------------------------------------------
class Core_Class_Form extends Zend_Form
{
protected $_tdDecorator = array(
'ViewHelper',
'Description',
'Errors',
array('decorator' => array('td' => 'HtmlTag'), 'options' =>
array('tag' => 'td', 'class' => 'wartosc')),
array('Label', array('tag' => 'th')),
array('decorator' => array('tr' => 'HtmlTag'), 'options' =>
array('tag' => 'tr'))
);
protected $_tableDecorator = array(
array('description' => array("description" =>
"description"), 'options' => array('tag' => '')),
array('caption' => array('caption' =>
'HtmlTag'), 'options' => array('tag' => 'caption')),
'FormElements',
array('HtmlTag',
array('tag' => 'table',
'class'=>'wysylka')),
'Form');
protected $_nakedDecorator = array('ViewHelper', 'Label');
public function __construct()
{
parent::__construct();
$this->setDecorators($this->_tableDecorator);
}
-----------------------------------------------------------------------------------
later, how to I create elements
-----------------------------------------------------------------------------------
$this->addElement(
$this->createElement('text', 'login')
->setDecorators($this->_tdDecorator)
->setLabel("Login")
->setRequired(true)
);
-----------------------------------------------------------------------------------
and now I have little problem. All of my rows are
<tr><th>name</th><td><input ...></td></tr>
and Now I want to have 3 inputs in <td>, sth like this:
<tr><th>Adress<th><td>Street: <input ...> home number <inpt ...> apt. number
<input ...></td></tr>
I don't know how do do this, I was trying with groups
-----------------------------------------------------------------------------------
$this->createElement('text', 'login')
->setDecorators($this->_nakedDecorator)
->setLabel("Login")
$this->setDefaultDisplayGroupClass($this->_tdDecorator);[/code]
-----------------------------------------------------------------------------------
but it doesn't work for me. I'm wondering about create new element
Zend_Form_Adress and connect here 3 inputs, but I don't know where can I
create it (no Zend folder) and how to add it tu my Form.
If anyone can help, I will be grateful
btw. sorry for my english
--
View this message in context:
http://www.nabble.com/Zend-Form%2C-Groups-and-decorators%2C-how-to---tp21397914p21397914.html
Sent from the Zend Framework mailing list archive at Nabble.com.