PHP & Zend Framework Custom Course

ProgressBG Logo

Agenda

Toggle sub-themes

PHP Fundamentals

Course Intro & Environment Setup

  1. Get to know each other
  2. Student's knowledge & codebase review
  3. Course roadmap and goals
  4. Setting up the development environment (PHP 8+, Apache/Nginx, MySQL).
  5. Docker for PHP development.
  6. Version Control with Git refresher.
  7. Code Editor/IDE setup and useful extensions.

PHP Modern Fundamentals

  1. PHP syntax and structure.
  2. PHP variables, data types, and operators.
  3. Control structures (if/else, switch, loops).
  4. Functions and arrays.
  5. Namespaces.
  6. Object-Oriented Programming (OOP) in PHP.
  7. Review of PHP 8+ features (Typed properties, Arrow functions, Match expression).
  8. Strict typing and type safety.
  9. Modern error handling (Try/Catch/Finally).
  10. Composer & Autoloading.

Server-side scripting using PHP to generate dynamic content.

  1. Working with forms and user input.
  2. File handling and uploads.
  3. Session and cookie management.
  4. Working with JSON and XML data.
  5. Error handling and debugging techniques.

Database & PDO

  1. PDO (PHP Data Objects) best practices.
  2. Prepared statements and preventing SQL Injection.
  3. Transactions and error handling.
  4. Data mapping concepts.

Zend Framework Fundamentals

Core Concepts & Architecture

  1. Understanding the MVC (Model-View-Controller) flow.
  2. Request/Response lifecycle in Laminas
  3. How MVC components interact
  4. Hands-on: Trace a request through a sample Laminas application
  5. Module Structure & Organization
  6. Hands-on: Create a basic module

Routing & Controllers

  1. Route types (Literal, Segment, Regex)
  2. Route parameters and constraints
  3. Creating and configuring routes
  4. Route matching and priority
  5. Controller basics and responsibilities
  6. Action methods and naming conventions
  7. Accessing request data (GET, POST, headers)
  8. Returning different response types
  9. Controller plugins overview
  10. Hands-on: Build routes and controllers for a CRUD module

View Layer & Templates

  1. View rendering process
  2. View models and data passing
  3. Template files and view scripts
  4. Layout system and hierarchical views
  5. View helpers (common and custom)
  6. Hands-on: Create templates with layouts and partials

Dependency Management

  1. Understanding the Service Container concept
  2. Service Manager configuration (factories, invokables, aliases)
  3. Dependency Injection patterns:
  4. Creating and registering services
  5. Using services in controllers
  6. Hands-on: Create custom services and inject them. Refactor a hard-coded controller to use DI.

Configuration Architecture

  1. Configuration file structure (global vs module configs)
  2. Configuration merging and priority
  3. Environment-specific configuration
  4. Accessing configuration in code
  5. Hands-on: Set up development/production configurations

Forms & Input Validation

  1. Form creation and fieldsets
  2. Form rendering in views
  3. InputFilter chains and validators
  4. Custom validators
  5. CSRF protection
  6. Hands-on: Build a contact form with validation

Database Interaction

  1. Laminas\Db overview and setup
  2. TableGateway pattern
  3. Writing queries (select, insert, update, delete)
  4. Joins and complex queries
  5. Result set handling
  6. Hands-on: Create a TableGateway for a database table

Hydrators

  1. Hydrator concept and use cases
  2. Common hydrators (ArraySerializable, ClassMethods, Reflection)
  3. Object ↔ Array conversion
  4. Using hydrators with forms and database
  5. Hands-on: Use hydrators to map form data to entities

Event Manager

  1. Event-driven architecture benefits
  2. Attaching event listeners
  3. Triggering events
  4. Common application events
  5. Creating custom events
  6. Hands-on: Add logging using events

Advanced Topics

Authentication & Authorization

  1. Authentication strategies (laminas-authentication).
  2. Authorization using ACL (laminas-permissions-acl) or RBAC.
  3. Session management security.

API Development & Integration

  1. RESTful API principles.
  2. Building API endpoints in Laminas.
  3. Content negotiation and JSON handling.
  4. Consuming 3rd party APIs with Laminas\Http\Client or Guzzle.

Revolut Virtual POS Integration

  1. Revolut Merchant API overview
  2. API authentication and credentials setup
  3. Creating and managing orders
  4. Payment flow implementation
  5. Handling Webhooks for payment status updates
  6. Webhook signature verification and security
  7. Error handling and retry logic
  8. Logging payment transactions
  9. Testing with Revolut Sandbox environment
  10. Handling edge cases (timeouts, failures, refunds)
  11. Hands-on: Build complete payment flow in client's site

Optional Topics

Testing Basics

  1. PHPUnit introduction
  2. Writing basic unit tests
  3. Testing controllers and services
  4. Mocking dependencies
  5. Hands-on: Write tests for a service class

Middleware (Mezzio/modern stack)

  1. PSR-15 middleware concepts
  2. Middleware pipeline
  3. Request/response flow through middleware

Integrating into Existing Site

  1. Review client's current codebase architecture
  2. Identifying integration points
  3. Migration strategy (gradual vs full)
  4. Maintaining backwards compatibility
  5. Deployment workflow and rollback plan
  6. Hands-on: Plan Revolut integration into client's site