Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created April 27, 2012 13:18
Show Gist options
  • Save eminetto/2509161 to your computer and use it in GitHub Desktop.
Save eminetto/2509161 to your computer and use it in GitHub Desktop.
Exemplo de form usando o Zend_Dojo_Form
<?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