Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
always learning

Elton Minetto eminetto

:octocat:
always learning
View GitHub Profile
View gist:987317
LoadModule rewrite_module modules/mod_rewrite.so
AddModule mod_rewrite.c
AllowOverride all
View gist:987319
LoadModule rewrite_module modules/mod_rewrite.so
AddModule mod_rewrite.c
AllowOverride all
View gist:987325
CREATE DATABASE blog;
GRANT ALL privileges ON blog.* TO zend@localhost IDENTIFIED BY 'zend';
USE blog;
CREATE  TABLE IF NOT EXISTS `users` (
  `id` INT NOT NULL AUTO_INCREMENT ,
  `username` VARCHAR(200) NOT NULL ,
  `password` VARCHAR(250) NOT NULL ,
View gist:987331
RewriteEngine On
RewriteRule !\.(js|ico|gif|jpg|png|css|htm|html)$ index.php
View gist:987332
<VirtualHost *:80>
DocumentRoot "/Applications/MAMP/htdocs/blog"
ServerName blog.local
SetEnv APPLICATION_ENV "development"
<Directory "/Applications/MAMP/htdocs/blog">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
View index.php
<?php
/**
 * Arquivo Principal da Aplicacao, responsavel pelo processamento
 * de todas as requisicoes, todos os caminhos para os arquivos
 * serao contruidos aqui para serem utilizados ao longo da requisicao
 * E responsavel tambem por carregar o front-controller da aplicacao
 * E por consequencia tambem carrega o controller requisitado
 * @author    Andre Gustavo Espeiorin <xorna@coderockr.com>
 * @author    Elton Luís Minetto <eminetto@coderockr.com>
 * @version    1.0
View gist:987340
;ambiente de desenvolvimento
[production]
;database
db.adapter = Pdo_Mysql
db.host = localhost
db.username = userName
db.password = password
db.dbname = dataBase
;translate
View gist:987343
<?php
class IndexController extends Zend_Controller_Action {
   
    public function showAction() {
       
    }
}
View gist:987345
<?php
class Admin_IndexController extends Zend_Controller_Action {
   
    public function showAction() {
       
    }
}
View gist:987348
$postRoute = new Zend_Controller_Router_Route(
    'post/:id',
    array(
        'module' => 'dafault',
        'controller' => 'post',
        'action' => 'view'
    )
);
$router = $frontController->getRouter();
$router->addRoute('post', $postRoute);