Zend Framework 2 (ZF2) is an open-source framework for developing web applications and services with PHP. ZF2 is implemented using 100% object-oriented code, with a component structure that incorporates a "use-at-will" design. The ZF2 architecture is extremely flexible, using events and listeners to shape application flow. Another powerful feature is service management, which allows developers to configure shared or unique services in order to build classes via factories which can inject parameters. Leveraging advanced PHP 5.3.x features such as namespaces and closures, ZF2 incorporates advanced design patterns, including MVC, publish/subscribe, and strategy, among others.

Audience

This course is designed for people who have a solid foundation in the PHP language and OOP, and have successfully created complex PHP web applications. This is an introductory course and assumes no previous Zend Framework 2 experience.

While this is a fundamental level course on Zend Framework 2, it requires more than a fundamental level understanding of PHP. We will do a short review of topics but in general participants are assumed to be proficient enough in the language to understand intermediate-level code examples and to perform coding exercises.

What will I learn?

“Zend Framework 2: Fundamentals is an essential class for the working PHP professional to quickly come up to speed writing ZF2 Modules and Applications. How to use the basics of the API and MVC framework are extensively covered. More important, the structural concepts of "PubSub", modules and Dependency Injection are covered to create more loosely coupled software components that will save your clients huge money over time. This class is highly suggested for independents, freelancers and corporate software engineers with a passion for excellence.”

John Dohoney, CTO & Owner RightSolutions Consulting

Class outline

1

INTRODUCTION TO ZF2 AND ESSENTIAL CONCEPTS

ZF2 Key Features

ZF2 Architecture

How ZF2 Works

ZF Architecture and MVC

Decoupling

Namespaces

Autoloading

2

DESIGN PATTERNS AND MVC

Design Patterns

MVC Elements and Implementation

ZF2 MVC: Event-Drive Architecture

Key MVC Events

Services in MVC

3

EVENT MANAGER AND SHARED EVENT MANAGER

Event Manager (EM)

Trigger Events

Available Methods

Aggregates

Shared Event Listeners

Identifiers

Shared Event Manager (SEM)

4

SERVICE MANAGER

Service Manager (SM)

Service Types

Configuring Services

5

MVC AND MODELS

Structure of an Application

Modules in MVC

Structure of a Module

Bootstrapping a Modular Application

Events

MVC-related Module Configuration

Zend\ModuleManager

ModuleManager Events and Listeners

Autoload Files for Modules

Module Classes

MVC 'bootstrap' Event

ModuleAutoloader and DefaultListenerAggreagte

Module Best Practices

6

CONTROLLERS

MVC Events and Controllers

MVC-based Action Controllers

AbstractActionControllers Interfaces

Controller Plugins

Accessing a Request and Response

Registering Module-specific Listeners

7

ROUTING

Routing Basics

ZF2 Router Types

ZF2 HTTP Route Types

8

VIEW LAYER

Zend\View

View Model

Layouts

Alternate Rendering & Response Strategies

PHP Renderer

View Helpers

9

INPUT VALIDATION

Zend\InputFilter\Input

Zend\Validator

Filtering

Zend\Form

Validating Forms

Rendering Forms

10

DATABASES

Zend\Db\Adapter

Creating an Adapter: Quick Start

Query Preparation & Execution

Creating Statements

Zend\Db\Sql

Zend\Db\TableGateway

Prerequisite(s)

Solid understanding of PHP at an intermediate to advanced level and OOP experience

What does it include?

This course provides a series of ten 2-hr, instructor-led lectures on the Zend Framework 2 design architecture, coupled with practical examples and student exercises. Participants are provided with a course guide, and the solution code for a practice application used as a teaching tool throughout the course. You will also be able to access the session recordings for a full 30 days after completion of the course, so that you have time to review the materials at your own pace, to solidify important concepts and advance your coding skills!