Created
April 27, 2012 13:18
-
-
Save eminetto/2509161 to your computer and use it in GitHub Desktop.
Exemplo de form usando o Zend_Dojo_Form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Application_Form_Post extends Zend_Dojo_Form | |
{ | |
public function init() | |
{ | |
$this->setName('Post'); | |
$this->setAttrib('id', 'FormTeste'); | |
$id = new Zend_Form_Element_Hidden('id'); | |
$this->addElement($id); | |
//dojo elements | |
$this->addElement( | |
'TextBox', | |
'title', | |
array( | |
'id' => 'teste', | |
'label' => 'Título', | |
'trim' => true, | |
'propercase' => true, | |
) | |
); | |
$this->addElement('editor', 'description', array( | |
'plugins' => array('undo', '|', 'bold', 'italic'), | |
'editActionInterval' => 2, | |
'focusOnLoad' => true, | |
'height' => '250px', | |
'inheritWidth' => true, | |
'styleSheets' => array('/js/custom/editor.css'), | |
)); | |
// $this->addElement( | |
// 'DateTextBox', | |
// 'data', | |
// array( | |
// 'label' => 'Date:', | |
// 'required' => true, | |
// 'invalidMessage' => 'Invalid date specified.', | |
// 'formatLength' => 'long', | |
// ) | |
// ); | |
$this->addElement( | |
'SubmitButton', | |
'submit', | |
array( | |
'required' => false, | |
'ignore' => true, | |
'label' => 'Salvar', | |
) | |
); | |
//action e method | |
$this->setAction('/post/create')->setMethod('post'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment