CakePHP 2 Application Cookbook

Over 60 useful recipes for rapid application development with the CakePHP framework.

CakePHP 2 Application Cookbook

Cookbook
James Watts, Jorge González

Over 60 useful recipes for rapid application development with the CakePHP framework.
$29.99
$49.99
RRP $29.99
RRP $49.99
eBook
Print + eBook
$12.99 p/month

Want this title & more? Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.
+ Collection
Free Sample

Book Details

ISBN 139781782160083
Paperback346 pages

About This Book

  • Be introduced to the fundamentals of the CakePHP framework with useful tips and tricks
  • Learn best practices and solve the most common problems direct from a CakePHP team member and official trainer
  • Create outstanding applications as efficiently as possible

Who This Book Is For

If you are a CakePHP developer looking to ease the burden of development, then this book is for you. As a headfirst dive into the framework, this collection of recipes will help you get the most out of CakePHP, and get your applications baked in no time. Even if you're not familiar with the framework, we'll take you from basic CRUD building to useful solutions that will aid in getting the job done quickly and efficiently.

Table of Contents

Chapter 1: Lightning Introduction
Introduction
Listing and viewing records
Adding and editing records
Deleting records
Adding a login
Including a plugin
Chapter 2: Advanced Routing
Introduction
Adding a prefix
Handling languages
Custom route class
Dispatch filter
Chapter 3: HTTP Negotiation
Introduction
Parsing extensions
Processing Ajax requests
Building a response
Uploading a file
Using a detector
Working with cookies
Cache control
Error handling
Chapter 4: API Strategies
Introduction
RESTful resources
Exposing a web service
Consuming a service
Authentication API
API versioning
Chapter 5: Using Authentication
Introduction
The HTTP authentication
Custom authorize class
Facebook authentication
Custom RBAC
Working with ACL
Chapter 6: Model Layer
Introduction
Has and belongs to many (HABTM)
Joining through
Containing models
Custom finders
On-the-fly associations
Using transactions
Chapter 7: Search and Pagination
Introduction
Pagination
Basic search and filter
The Search plugin
Advanced search
Chapter 8: Events System
Introduction
Listeners and subscribers
Event-driven process
Event stacking
Managing event priorities
Chapter 9: Creating Shells
Introduction
Console API
Import parser
Running cron shells
Using the I18n shell
Chapter 10: View Templates
Introduction
Using blocks
Building an XML view
Generating a PDF
Writing some PDF content to a file
Translations
View caching
The AssetCompress plugin
Chapter 11: Unit Tests
Introduction
Dependency Injection
Creating a fixture
Mock objects
Stub method configuration
Model unit testing
Chapter 12: Migrations
Introduction
Schema handling
Syncing changes
The Migrations plugin
Injecting data

What You Will Learn

  • Start developing quickly with a lightning-fast introduction to CakePHP
  • Handle HTTP requests and responses, and common tasks such as file uploads and Ajax calls
  • Get up-close and personal with the framework's model layer and events system
  • Discover various routing techniques and a selection of API strategies
  • Fully exploit the command line and CakePHP's shell capabilities
  • Get introduced to the fundamentals of unit testing in the framework
  • See how easily you can maintain and migrate your application's database schema

In Detail

CakePHP is the most popular rapid application development framework for PHP. For over 10 years, this open source project has been the go-to solution for quickly and easily building websites and web applications.

Through a series of over 60 recipes, this book takes you from the basic building blocks of the CakePHP framework to the implementation of routine tasks that will help speed up your development even further. From routing to authentication, the model layer and the events system, as well as views and unit testing, you'll learn how to handle the ins and outs of developments using CakePHP. With fast paced recipes written by a core CakePHP member and official trainer, this book is your piece of the cake!

Authors

Table of Contents

Chapter 1: Lightning Introduction
Introduction
Listing and viewing records
Adding and editing records
Deleting records
Adding a login
Including a plugin
Chapter 2: Advanced Routing
Introduction
Adding a prefix
Handling languages
Custom route class
Dispatch filter
Chapter 3: HTTP Negotiation
Introduction
Parsing extensions
Processing Ajax requests
Building a response
Uploading a file
Using a detector
Working with cookies
Cache control
Error handling
Chapter 4: API Strategies
Introduction
RESTful resources
Exposing a web service
Consuming a service
Authentication API
API versioning
Chapter 5: Using Authentication
Introduction
The HTTP authentication
Custom authorize class
Facebook authentication
Custom RBAC
Working with ACL
Chapter 6: Model Layer
Introduction
Has and belongs to many (HABTM)
Joining through
Containing models
Custom finders
On-the-fly associations
Using transactions
Chapter 7: Search and Pagination
Introduction
Pagination
Basic search and filter
The Search plugin
Advanced search
Chapter 8: Events System
Introduction
Listeners and subscribers
Event-driven process
Event stacking
Managing event priorities
Chapter 9: Creating Shells
Introduction
Console API
Import parser
Running cron shells
Using the I18n shell
Chapter 10: View Templates
Introduction
Using blocks
Building an XML view
Generating a PDF
Writing some PDF content to a file
Translations
View caching
The AssetCompress plugin
Chapter 11: Unit Tests
Introduction
Dependency Injection
Creating a fixture
Mock objects
Stub method configuration
Model unit testing
Chapter 12: Migrations
Introduction
Schema handling
Syncing changes
The Migrations plugin
Injecting data

Book Details

ISBN 139781782160083
Paperback346 pages
Read More

Recommended for You

CakePHP 1.3 Application Development Cookbook
$ 23.99
Magento PHP Developer’s Guide - Second Edition
$ 35.99
CodeIgniter 1.7 Professional Development
$ 23.99
WordPress Responsive Theme Design
$ 22.40