Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
always learning

Elton Minetto eminetto

:octocat:
always learning
View GitHub Profile
View PostController.php
<?php
namespace Application\Controller;
use Zend\View\Model\ViewModel;
use Zend\Mvc\Controller\AbstractActionController;
/**
* Controlador que gerencia os posts
*
* @category Application
View Post.php
<?php
namespace Application\Model;
use Zend\InputFilter\InputFilter;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\InputFilterInterface;
class Post implements InputFilterAwareInterface
{
View global.php
<?php
return array(
'service_manager' => array(
'factories' => array(
'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory',
),
),
'db' => array(
'driver' => 'Pdo',
'dsn' => 'mysql:dbname=iniciandozf2;host=localhost',
View gist:b6487feb6f0de85ada38
'service_manager' => array(
'abstract_factories' => array(
'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
'Zend\Log\LoggerAbstractServiceFactory',
),
'aliases' => array(
'translator' => 'MvcTranslator',
),
'factories' => array(
'Application\Model\PostTableGateway' => function($sm) {
View index.phtml
<div class="actions clearfix">
<div class="btns">
<a class="btn btn-primary" href="/post/save" title="Criar Post">
Criar Post
</a>
</div>
</div>
<h3>Lista de Posts</h3>
<table class="table table-striped table-bordered">
<thead>
View gist:ce1ce0286d6450ac5116
'post' => array(
'type' => 'segment',
'options' => array(
'route' => '/post[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Application\Controller\Post',
View gist:90e15b854448fcad068b
Feature: Cálculo do total de receitas
In order to calcular o total de receitas da obra
As a usuário logado no sistema
I need visualizar o resultado do cálculo do total de receitas
Scenario: Venda de duas unidades
Given seja vendida uma unidade no valor de R$ 150.000,00
And seja vendida uma unidade no valor de R$ 50.000,00
When eu solicitar o cálculo do total de receitas
Then o sistema deve retornar o total de R$ 200.000,00
View gist:ba666b73cf86bd7e36af
array(3) {
[0] =>
array(1) {
'Money' =>
array(1) {
[0] =>
array(4) {
...
}
}
View gist:66402d11be8273da9ebb
sudo ln -s /Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl /usr/bin/subl
View gist:a5ff196d911aa5b10b93
{{ date("d M Y", strtotime($article->created_at)) }} às
{{ date("G:i", strtotime($article->created_at)) }}