Upload
rafaelfqf
View
121
Download
6
Embed Size (px)
DESCRIPTION
Meetup PHP-PB, 14/10/2014
Citation preview
Desenvolvimento Ágil com CakePHP
Apresentação
http://www.zend.com/en/yellow-pages/ZEND024124
http://br.linkedin.com/in/rafaelfqf
Rafael [email protected]
Introdução a CakePHP
● MVC Framework● MIT License● 8+ anos (maduro)● Convenção sobre configuração● Plugins / Testes● Comunidade
Rafael [email protected]
Começando com CakePHP
● Webserver Apache / Nginx (URL’s amigáveis)● MySQL 5● PHP 5.3 (> 5.2.8)
Rafael [email protected]
Requisitos
Constantes
● ROOT-> ~/www
● APP_DIR-> <name>
● CAKE_CORE_INCLUDE_PATH-> /var/www/cakephp/2.5.5
Rafael [email protected]
Configurações
● Config/core.php○ Debug○ Session○ Salt○ Cache
Rafael [email protected]
● Config/database.php● Config/bootstrap.php● Config/email.php
Convenções
● Controller○ name: UsersController○ public method: customAction
● Model○ name: User
● View○ View/Users/custom_action.ctp
Rafael [email protected]
● URLs○ /users/custom_action
● Database○ tables: plural, underscored○ 'id' field: int○ 'name', 'title' : field○ 'created', 'modified': datetime○ 'model_id': relation
Rafael [email protected]
● Console● Instalação● ORM
● Usando○ generate -f○ status
● Executando○ run all -p○ run up○ run down
Migrations
Rafael [email protected]
Scaffolding com bake
● É uma maneira rápida de você criar um CRUD
● Não é destinado para o ambiente de produção
● Comandos○ project○ <name> all○ model○ view○ controller
Desenvolvimento Ágil com CakePHP
OBRIGADO!