Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Zend Framework 2 Cookbook

You're reading from   Zend Framework 2 Cookbook If you are pretty handy with PHP, this book is the perfect way to access and understand the features of Zend Framework 2. You can dip into the recipes as you wish and learn at your own pace.

Arrow left icon
Product type Paperback
Published in Dec 2013
Publisher Packt
ISBN-13 9781849694841
Length 340 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
joseph@callaa.rs joseph@callaa.rs
Author Profile Icon joseph@callaa.rs
joseph@callaa.rs
Josephus Callaars Josephus Callaars
Author Profile Icon Josephus Callaars
Josephus Callaars
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Zend Framework 2 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Zend Framework 2 Basics FREE CHAPTER 2. Translating and Mail Handling 3. Handling and Decorating Forms 4. Using View 5. Configuring and Using Databases 6. Modules, Models, and Services 7. Handling Authentication 8. Optimizing Performance 9. Catching Bugs Setting up the Essentials Index

Preface

A couple of years ago I was introduced to Zend Framework 1 by a friend of mine, and since then I have been a fan. Although the first framework was a real bulky framework with not much documentation, I feel that the second version of the framework improved greatly. The incredible toolshed full of features, makes this framework (personally) one of the best frameworks to work in.

But as we all probably know, because of its incredibly vast library of features the learning curve can appear very steep. That is why I felt the need to write about all the important parts of the framework, in bite-size pieces that don't overwhelm someone (you in this case) who wants to learn it.

What this book covers

Chapter 1, Zend Framework 2 Basics, talks about how we can set up a small application and run it. The dependency injection and configuration are also handled.

Chapter 2, Translating and Mail Handling, explains the importance of internationalization and localization, and the overall handling of sending and receiving of mails in our applications.

Chapter 3, Handling and Decorating Forms, demonstrates how forms are created. After that it talks about filtering, validation, and decoration of forms.

Chapter 4, Using View, covers one of the most important parts of the framework that will be discussed here, setting and rendering of the View.

Chapter 5, Configuring and Using Databases, gives out the configuration and explanation of databases that will give us an insight into how we can fully utilize them in our application.

Chapter 6, Modules, Models, and Services, mainly discusses how modules are built up, models can be hydrated, and services are defined.

Chapter 7, Handling Authentication, delves into the different ways of authenticating users and how we can create our own authentication method.

Chapter 8, Optimizing Performance, discusses the use of caching and the methods available to cache output, opcode, and how to use plugins.

Chapter 9, Catching Bugs, teaches us how to debug applications, handle exceptions, and log stuff.

Appendix, Setting up the Essentials, shows where we can find the documentation, how to set up a development environment, and shows how the composer works.

What you need for this book

To follow the book in the best possible way I would recommend using a Linux-based web server, as most of the recipes are more Linux oriented than Windows. If you are a Windows user you'll probably be better off installing a virtual machine with Linux on it, or installing a Zend Server community edition to make sure your machine is compatible for Zend Framework 2 development (you can also do this without Zend Server, but it is just more convenient).

Who this book is for

Zend Framework 2 Cookbook is for PHP developers who are fairly advanced in PHP programming. It will also be useful for developers who have a keen interest in expanding their knowledge outside the boundaries of simply scripting pages together. As unit testing and MVC will be discussed, it is beneficial for the reader to know what these technologies are, although experience with developing applications is not necessarily essential.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can either get the flags from a message by using the getFlags() method, or by using the hasFlag() method."

A block of code is set as follows:

<?php
echo $this->dateFormat(
    // Format the current UNIX timestamp.
    time(),

    // Our date is to be a LONG date format.
    IntlDateFormatter::LONG,

    // We want to omit the time, defining this is 
    // optional as the default is NONE.
    IntlDateFormatter::NONE

);

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

SampleModule/
  config/
    module.config.php
  language/
  src/
    SampleModule/
      Controller/
        IndexController.php
  view/
    samplemodule/
      index/
        index.phtml
  Module.php

Any command-line input or output is written as follows:

php composer.phar update

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "After we have done all that we can, click on OK and you can choose a location to save our file."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image