Description
Course info
Level
Intermediate
Updated
Apr 27, 2018
Duration
2h 2m
Description

The Zend Expressive framework is one of the leading micro-frameworks for PHP and is one that every PHP developer should understand. In this course, Zend Expressive Essentials, you'll learn the absolute essentials to get started creating applications with Zend Expressive. First, you'll explore Zend Expressive’s central concepts of routing and dependency injection. Next, you'll learn all about templating, error handling and, most importantly, middleware. Finally, you'll discover how to build applications both with and without any command-line tooling support. By the end of this course, you'll be able to begin building applications with the Zend Expressive Framework.

About the author
About the author

Matthew Setter is a freelance software developer, with over 10 years development experience, specializing in PHP, Zend Framework, and JavaScript. He's also a freelance technical writer, founder, and editor of Master Zend Framework, which is dedicated to helping developers master Zend Framework.

More from the author
Zend Db Deep Dive
Intermediate
2h 4m
2 Sep 2016
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone. My name is Matthew Setter and welcome to my course, Zend Expressive Essentials. I'm a freelance software engineer who's spent years around both PHP and the various versions of Zend Framework, as well as other web development frameworks. Zend Expressive is the new shiny framework for building microapplications in PHP. Whether you're building a single page app, an API, or a full-stack application, one backed by container-provided services, Zend Expressive has you covered. If you want the absolute essentials to get started creating applications with Zend Expressive, then this is the course for you. In this course, you are going to learn the essentials that you need to know to get up and running with the framework in the shortest amount of time possible. Some of the major topics that we'll cover include Zend Expressive's core components and concepts, how to build an application by hand, no you don't need command line support, how to build an application using the Skeleton Installer project and command line tooling, how to augment expressive apps like integrating external libraries, and how to construct powerful yet flexible, middleware pipelines. By the end of this course, you'll know the essentials for building powerful, flexible, and capable web-based applications using Zend Expressive. With that said, before beginning the course, you should be familiar with PHP, web application development, and ideally, have a bit of working knowledge of microframeworks. If you're not familiar with these terms, don't worry, there are some excellent courses already available in Pluralsight's extensive library. I hope you'll join me on this journey to learn Zend Expressive with my Zend Expressive Essentials course at Pluralsight.

Getting Set Up
Well hello and welcome to the first module of the Zend Expressive Essentials course. This one is where we're going to get all set up and ready to go so that you're all prepped to get in and do everything you need to do in all the later modules. But before we dive on in though, who am I? Your gainful teacher? Your benevolent dictator for life? I'm just joking. Who am I and why did I create this course? Well, I'm not assuming that you've heard of me, but perhaps you have. Perhaps you recognize what I was told once were these dulcet tones. Regardless of if you have or you haven't, I'm Matthew Setter. I've been a software developer for about 20 years now and have been part of the Zend Framework community, more or less, since about Zend Framework 1. 0. That does make me a little bit old, but such is life. You don't get lovely gray hair like mine being a young man. Anyway, more specifically, I'm an ethical hacker, freelance software developer, technical writer, teacher, and podcaster with a strong focus on security, TDD, BDD, all the DDs, continuous integration, continuous development, and all that fun stuff. During the brief time I've been talking so far, you may have picked up an ever so slight accent. Yes, I am an Australian, and I'm also very proud of it, otherwise, I guess I wouldn't mention it. Anyway, I hope that that's not going to make me hard to understand. But if so, I will do my best to speak as clearly as possible.

Creating an Application Using The Skeleton Installer
Alright, things are getting even more exciting. This is the section of the course that I've been wanting to get to for ages. I'll be honest, I love, big heart there, the Skeleton installer. At least in my opinion, it makes like just so much easier. Now previously, we saw how to build a Zend Expressive application manually. While incredibly insightful, and there's nothing wrong with doing that, it was also a lot of work. It's for that reason that I generally recommend using the Zend Expressive Skeleton installer instead, which you can find here at github. com/zendframework/zend-expressive-skeleton. Now I should be completely transparent. I deliberately went through the process of creating an application manually so that you'd get a complete understanding of exactly what's involved in creating an application using Zend Expressive and that you'd appreciate just how much of a timesaver the Skeleton installer is. So now that I've given it a big kind of enthusiastic plug, let's get a concise overview of what you get. It creates a standard directory and file structure. It creates a default route, accompanying middleware, and view templates. It initializes the DI container with a base set of required services. It creates a development namespace and a whole stack more. In short, it saves us time and effort. Now, with that said, let's get in and learn how to use the Skeleton installer to recreate most of the application, which we created by hand in a fraction of the time. By the end of this section, we're going to have all that we previously did plus a whole lot more.

Increasing the Power of an Application
Welcome to the next section of the course where you're going to learn how to increase your application's power. We've created a working application both by hand and by using the Zend Expressive Skeleton installer; however, it doesn't do much except print out a list of movies as the previous iteration of the application did. Now there's nothing wrong with that; however, there's nothing either unique nor sophisticated about it either. What's more, the information is stored in a PHP array. Storing it this way makes for rapid data retrieval, but it's not distributable nor scalable. If this were a real application, we'd store the data in a better way in a database or some other data store. Since we find ourselves in this situation, we now have the opportunity to explore another compelling feature of Zend Expressive. It's one that's perhaps not so obvious, but it's the ability to quickly augment an application's power. Now as I said near the start of the course, Zend Expressive, like other microframeworks, doesn't provide a lot of functionality out of the box. You get the absolute basic level of functionality that you need to build a working application. Then you build on that base as and when necessary. Now this approach may seem a bit limiting, but it's not. Other frameworks require you to follow certain predefined steps or paths to expand their functionality. Some take the approach of requiring you to implement specific interfaces or put classes in particular locations. Zend Expressive is more flexible. Now you only need to do two things really. Firstly, register services with a DI container, and secondly, retrieve the services from the DI container.

Building Powerful Middleware Pipelines
Okay, here we are in the last section of the course. To finish up, I want to step you through a variety of ways in which you can configure middleware pipelines in your applications. Specifically, we'll assume that we have two additional pieces of middleware, which provide authentication and authorization functionality for our application. We'll see how we can organize them in different ways based on various needs. We're not going to step through every possible option, rather choosing to focus on four key ones. We'll step through from the basic, right up to the more advanced options. Hopefully one or more of them will appeal to you and suit the needs of your current or perhaps future applications.