Gift Guide

Zend Framework, A Beginner's Guide


Essential Skills—Made Easy!

Leverage the power of the Zend Framework to supercharge your PHP development! Zend Framework: A Beginner's Guide covers key features, including model-view-controller implementation, routing, input validation, internationalization, and caching, and shows you how to use them in a practical context. The book walks you through the process of building a complete Web application with the Zend Framework, starting with the basics and then adding in more ...

See more details below
Other sellers (Paperback)
  • All (15) from $4.98   
  • New (10) from $21.33   
  • Used (5) from $4.98   
Zend Framework, A Beginner's Guide

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$22.99 price
(Save 42%)$39.99 List Price


Essential Skills—Made Easy!

Leverage the power of the Zend Framework to supercharge your PHP development! Zend Framework: A Beginner's Guide covers key features, including model-view-controller implementation, routing, input validation, internationalization, and caching, and shows you how to use them in a practical context. The book walks you through the process of building a complete Web application with the Zend Framework, starting with the basics and then adding in more complex elements, such as data pagination and sorting, user authentication, exception handling, localization, and Web services. Debugging and performance optimization are also covered in this fast-paced tutorial.

Designed for Easy Learning

  • Key Skills & Concepts—Chapter-opening lists of specific skills covered in the chapter
  • Ask the Expert—Q&A sections filled with bonus information and helpful tips
  • Try This—Hands-on exercises that show you how to apply your skills
  • Notes—Extra information related to the topic being covered
  • Tips—Helpful reminders or alternate ways of doing things
  • Cautions—Errors and pitfalls to avoid
  • Annotated Syntax—Example code with commentary that describes the programming techniques being illustrated

Read-to-use code at and

Read More Show Less

Product Details

  • ISBN-13: 9780071639392
  • Publisher: McGraw-Hill Professional Publishing
  • Publication date: 7/22/2010
  • Series: Beginner's Guide Series
  • Edition number: 1
  • Pages: 464
  • Sales rank: 1,452,323
  • Product dimensions: 7.30 (w) x 9.00 (h) x 0.80 (d)

Meet the Author

Vikram Vaswani is the founder and CEO of Melonfire (, a consultancy firm with special expertise in open-source tools and technologies. He has 12 years of experience working with PHP and MySQL as a Web application developer and product manager. Vikram writes a regular column for the Zend Developer Zone and is the author of MySQL: The Complete Reference, How to Do Everything with PHP and MySQL, PHP Programming Solutions, PHP: A Beginner's Guide, and several other books.

Read More Show Less

Table of Contents




1 Introducing the Zend Framework 1

Overview 3

Features 4

Standards Compliance and Best Practices 4

Reusability 4

Internationalization 5

Open Source 5

Community Support 5

Unique Advantages 5

Loose Coupling 5

Rapid Release Cycle 6

Unit Testing Policy 6

Code-Generation Tools 6

Market Credibility 6

Third-Party Application Interoperability 6

Commercial Support Options 7

Extensive Documentation 7

Application Environment 7

Installing the Zend Framework 8

Try This 1-1 Starting a New Project 10

Understand Application Requirements 11

Create the Application Directory 11

Create the Application Skeleton 11

Add Zend Framework Libraries 13

Define Virtual Host Settings 13

Using the Command-Line Tool 14

Summary 17

2 Working with Models, Views, Controllers, and Routes 19

Understanding Basic Concepts 20

Models 21

Views 22

Controllers 23

Modules 24

Routes 25

Layouts 25

Understanding Component Interaction 26

Looking Behind the Default Index Page 28

Understanding the Modular Directory Layout 30

Try This 2-1 Using a Modular Directory Layout 32

Creating the Default Module 33

Updating the Application Configuration File 33

Understanding Master Layouts and Custom Routes 33

Updating the Application Index Page 35

Setting a Master Layout 36

Using a Custom Route 37

Try This 2-2 Serving Static Content 39

Defining Custom Routes 39

Defining the Controller 40

Defining the View 41

Updating the Master Layout 42

Summary 44

3 Working with Forms 47

Understanding Form Basics 48

Creating Forms and Form Elements 53

Working with Form Elements 55

Setting Required and Default Values 65

Filtering and Validating Form Input 70

Using Input Filters 70

Using Input Validators 73

Retrieving and Processing Form Input 81

Try This 3-1 Creating a Contact Form 82

Defining the Form 82

Using a Custom Namespace 85

Defining a Custom Route 85

Defining Controllers and Views 86

Updating the Master Layout 88

Customizing Form Appearance 90

Using Custom Error Messages 91

Using Display Groups 93

Using Decorators 94

Summary 99

4 Working with Models 101

Understanding Models 102

Model Patterns 105

Model Scope 105

Installing Doctrine 107

Try This 4-1 Generating and Integrating Doctrine Models 108

Initializing the Application Database 109

Generating Doctrine Models 113

Setting Model Relationships 115

Autoloading Doctrine 116

Working with Doctrine Models 118

Retrieving Records 118

Adding, Updating, and Deleting Records 120

Try This 4-2 Retrieving Database Records 122

Creating a New Module 122

Defining a Custom Route 122

Defining the Controller 122

Defining the View 124

Summary 127

5 Handling Crud Operations 129

Try This 5-1 Creating Database Records 130

Defining the Form 130

Defining Controllers and Views 136

Working with Administrative Actions 140

Structure 140

Routing 141

Layout 142

Try This 5-2 Listing, Deleting, and Updating Database Records 142

Setting the Administrative Layout 142

Defining Custom Routes 144

Defining the List Action and View 146

Defining the Delete Action 148

Defining the Update Form 150

Defining the Update Action and View 154

Updating the Display Action 157

Adding User Authentication 158

Try This 5-3 Creating a Login/Logout System 161

Defining Custom Routes 161

Defining the Login Form 161

Defining the Authentication Adapter 162

Defining the Login Action and View 165

Defining the Logout Action 167

Protecting Administrative Actions 167

Updating the Master Layout 168

Summary 170

6 Indexing, Searching, and Formatting Data 173

Try This 6-l Searching and Filtering Database Records 174

Defining the Search Form 174

Defining the Controller and View 177

Updating the Master Layout 179

Adding Full-Text Search 181

Indexing Data 182

Searching Data 184

Try This 6-2 Creating a Full-Text Search Engine 185

Defining the Index Location 185

Defining Custom Routes 186

Defining the Index Action and View 186

Updating the Summary View 188

Updating the Search Form 188

Updating the Search Action and View 189

Handling Multiple Output Types 192

Try This 6-3 Expressing Search Results in XML 194

Enabling the XML Context 194

Defining the XML View 194

Summary 196

7 Paging, Sorting, and Uploading Data 199

Try This 7-1 Paging and Sorting Database Records 200

Adding Page Numbers to Routes 201

Updating the Index Controller and View 201

Adding Sort Criteria to Routes 204

Updating the Controller and View 204

Working with File Uploads 209

Try This 7-2 Enabling Image Uploads 213

Defining the Upload Destination 213

Updating the Form Definition 213

Updating the Create Action 215

Updating the Display Action and View 216

Updating the Delete Action 218

Working with Configuration Data 222

Reading Configuration Files 222

Writing Configuration Files 224

Try This 7-3 Configuring Application Settings 227

Defining the Configuration Form 227

Defining the Configuration File 229

Defining Custom Routes 230

Defining the Controller and View 231

Updating the Master Layout 233

Using Configuration Data 235

Summary 239

8 Logging and Debugging Exceptions 241

Understanding Exceptions 242

Understanding the Default Error-Handling Process 246

Using Custom Exception Classes 249

Controlling Exception Visibility 251

Try This 8-1 Creating a Custom Error Page 252

Logging Data 254

Writing Log Messages 254

Adding Data to Log Messages 259

Formatting Log Messages 259

Try This 8-2 Logging Application Exceptions 263

Defining the Log Location 263

Defining the Database Log Writer 264

Updating the Error Controller 265

Summary 268

9 Understanding Application Localization 271

Understanding Localization and Locales 272

Setting the Application Locales 274

Localizing Numbers 277

Localizing Dates and Times 279

Localizing Currencies 282

Localizing Measurements 285

Localizing Strings 287

Working with Adapters and Data Sources 289

Using the Application Locale 291

Using the Translation View Helper 293

Try This 9-1 Localizing the Example Application 294

Setting the Application Locale 294

Localizing Numbers and Dates 294

Defining String Localization Targets 298

Creating Translation Sources 300

Registering the Translation Object 302

Supporting Manual Locale Selection 306

Updating the Master Layout 307

Summary 309

10 Working with News Feeds and Web Services 311

Working with News Feeds 312

Understanding News Feed Formats 313

Consuming News Feeds 313

Creating News Feeds 317

Accessing Web Services 319

Understanding Web Services 319

Consuming Web Services 322

Try This 10-1 Integrating Twitter and Blog Search Results 328

Defining Custom Routes 328

Defining the Controller and View 328

Updating the Master Layout 331

Creating REST-Based Web Services 332

Understanding REST Routes 332

Try This 10-2 Implementing REST-Based Web Services 334

Creating a New Module 334

Defining the Controller 334

Defining the GET Actions 336

Defining the POST Action 339

Initializing the REST Routes 340

Summary 342

11 Working with User Interface Elements 345

Working with Navigation Structures 346

Understanding Pages and Containers 346

Rendering Navigational Elements 351

Try This 11-1 Adding a Navigation Menu 355

Defining Navigation Pages and Containers 355

Registering the Navigation Object 357

Creating the Navigation Action Helper 358

Using the Menu View Helper 359

Working with the Dojo Toolkit 361

Handling Dojo Data 361

Using the Dojo View Helpers 362

Using Dojo Form Elements 365

Try This 11-2 Adding a Dojo Autocomplete Widget 368

Updating the Contact Form 368

Initializing the Dojo View Helper 369

Updating the Master Layout 370

Updating the Controller 371

Try This 11-3 Adding a YUI Calendar Widget 372

Updating the Form 372

Updating the Master Layout 374

Updating the Controller 375

Updating the View 377

Summary 378

12 Optimizing Performance 381

Analyzing Performance 382

Benchmarking 382

Code Profiling 384

Query Profiling 387

Caching Data 392

Understanding Cache Operations 392

Understanding Cache Frontends and Backends 395

Using the Cache Manager 398

Caching Doctrine Queries 399

Optimizing Application Code 401

Query Tuning 401

Lazy Loading 404

Try This 12-1 Improving Application Performance 405

Configuring the Application Cache 405

Caching Translation Strings 406

Caching Query Results 406

Caching Twitter and Blog Feeds 408

Summary 410

A Installing and Configuring Required Software 413

Obtaining the Software 414

Installing and Configuring the Software 416

Installing on UNIX 416

Installing on Windows 420

Testing the Software 426

Testing MySQL 426

Testing PHP 427

Setting the MySQL Superu-User Password 428

Summary 428

Index 429

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)