Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying CakePHP 2 Application Cookbook
  • Table Of Contents Toc
CakePHP 2 Application Cookbook

CakePHP 2 Application Cookbook - Third Edition

By : Watts
4.2 (6)
close
close
CakePHP 2 Application Cookbook

CakePHP 2 Application Cookbook

4.2 (6)
By: Watts

Overview of this book

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 (14 chapters)
close
close
13
Index

Event-driven process


Events in CakePHP can also be used to define complex workflows in your application. In this recipe, we'll process a package, which was just created, to generate a PDF order and send the resulting file by e-mail (attachment) for further manual processing.

We'll chain the execution of two listeners for a specific event. The partial results of each listener will be stacked in our event, thus allowing listeners to use partial results from listeners that were executed earlier in the event manager queue.

Note that as discussed earlier, sending e-mails and generating PDF files are slow operations, so you should consider moving this logic to a job queue, instead of running them while the user waits.

Getting ready

For this recipe, we'll need to set up the CakePDF plugin and the related templates to generate a PDF file based on a Package model. We'll use git modules for the setup, but if you're not using git, you can simply download the ZIP file using the following command and place...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
CakePHP 2 Application Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon