Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
always learning

Elton Minetto eminetto

:octocat:
always learning
View GitHub Profile
View Users.php
<?php
/**
* Modelo da tabela users
*
*/
class Application_Model_Users extends Zend_Db_Table_Abstract
{
protected $_name = 'users';
}
View Posts.php
<?php
/**
* Modelo da tabela posts
*
*/
class Application_Model_Posts extends Zend_Db_Table_Abstract
{
  protected $_name = 'posts';  
  protected $_dependentTables = array('Comments'); 
}
View Comments.php
<?php
/**
* Modelo da tabela comments
*
*/
class Application_Model_Comments extends Zend_Db_Table_Abstract
{
   protected $_name = 'comments';
   protected $_referenceMap = array(
    'Post' => array (
View gist:987360
<?php
class IndexController extends Zend_Controller_Action {
   
    public function indexAction() {
        //cria uma variável a ser mostrada na view
        $this->view->msg = 'Hello!';
    }
}
View gist:987362
<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) {
View LoginForm.php
<?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');
View PostForm.php
<?php
class PostForm extends Zend_Form
{
    public function __construct($options = null) {
        parent::__construct($options);
        $this->generate();
    }
   
    private function generate() {
View AlbumForm.php
<?php
class AlbumForm extends Zend_Form
{
    public function __construct($options = null) {
        parent::__construct($options);
        $this->generate();
    }
   
    private function generate() {
        $this->setName('Foto');
View AlbumController.php
<?php
/**
 * Album
 *
 * @package default
 * @author Elton Minetto
 **/
class AlbumController extends Zend_Controller_Action {
   
    /**
View PessoaForm.php
<?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');