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 | |
/** | |
* Modelo da tabela users | |
* | |
*/ | |
class Application_Model_Users extends Zend_Db_Table_Abstract | |
{ | |
protected $_name = 'users'; | |
} |
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 | |
/** | |
* Modelo da tabela posts | |
* | |
*/ | |
class Application_Model_Posts extends Zend_Db_Table_Abstract | |
{ | |
protected $_name = 'posts'; | |
protected $_dependentTables = array('Comments'); | |
} |
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 | |
/** | |
* Modelo da tabela comments | |
* | |
*/ | |
class Application_Model_Comments extends Zend_Db_Table_Abstract | |
{ | |
protected $_name = 'comments'; | |
protected $_referenceMap = array( | |
'Post' => array ( |
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 IndexController extends Zend_Controller_Action { | |
public function indexAction() { | |
//cria uma variável a ser mostrada na view | |
$this->view->msg = 'Hello!'; | |
} | |
} |
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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> | |
<title></title> | |
</head> | |
<body> | |
<?php | |
//mostra as mensagens de erro caso existam | |
$session = Zend_Registry::get('session'); | |
if($session->erro) { |
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 LoginForm extends Zend_Form | |
{ | |
public function __construct($options = null) { | |
parent::__construct($options); | |
$this->generate(); | |
} | |
private function generate() { | |
//nome do formulário | |
$this->setName('Login'); |
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 PostForm extends Zend_Form | |
{ | |
public function __construct($options = null) { | |
parent::__construct($options); | |
$this->generate(); | |
} | |
private function generate() { |
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 AlbumForm extends Zend_Form | |
{ | |
public function __construct($options = null) { | |
parent::__construct($options); | |
$this->generate(); | |
} | |
private function generate() { | |
$this->setName('Foto'); |
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 | |
/** | |
* Album | |
* | |
* @package default | |
* @author Elton Minetto | |
**/ | |
class AlbumController extends Zend_Controller_Action { | |
/** |
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 | |
abstract class PessoaForm extends Zend_Form { | |
public function __construct($options = null) { | |
parent::__construct($options); | |
$this->generate(); | |
} | |
private function generate() { | |
$this->setName('Login'); | |
$username = new Zend_Form_Element_Text('username'); | |
$username->setLabel('Login')->setRequired(true)->addFilter('StripTags')->addValidator('NotEmpty'); |