Getting Started with Phalcon

Getting Started with Phalcon
eBook: $17.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $47.98    Print cover: $29.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters

Build impressive web applications with the pace of C, the ease of PHP, and the structure of the MVC framework Use Phalcon Developer Tools to build a scaffolding for your project in minutes Detailed instructions and examples help you build an impressive blog application using Phalcon PHP quickly and easily

Book Details

Language : English
Paperback : 138 pages [ 235mm x 191mm ]
Release Date : January 2014
ISBN : 1783287675
ISBN 13 : 9781783287673
Author(s) : Stephan A. Miller
Topics and Technologies : All Books, Application Development, Web Development, Open Source

Table of Contents

Chapter 1: Installing Phalcon
Chapter 2: Setting Up a Phalcon Project
Chapter 3: Using Phalcon Models, Views, and Controllers
Chapter 4: Handling Data in Phalcon
Chapter 5: Using Phalcon's Features
  • Chapter 1: Installing Phalcon
    • Phalcon system requirements
    • Installing Phalcon on Windows
    • Installing Phalcon on Linux
    • Installing Phalcon on Mac
    • Installing Phalcon on FreeBSD
    • Optional Phalcon dependencies
    • Finding help
    • Summary
  • Chapter 2: Setting Up a Phalcon Project
    • Folder structure
    • Using .htaccess files
    • The bootstrap file
      • Handling exceptions
      • Dependency Injection
      • Autoloaders
      • Initializing our application
    • Using a configuration file
    • Phalcon Developer Tools
      • Installing Phalcon Developer Tools
      • Generating a project skeleton
      • Available commands
      • The web interface
      • IDE stubs
    • Setting up Phalcon\Debug
    • Nginx configuration
    • Summary
  • Chapter 3: Using Phalcon Models, Views, and Controllers
    • Introducing MVC
      • View
      • Controller
      • Model
    • Creating a database
    • Creating a model
    • Creating a controller
    • Creating CRUD scaffolding
    • Examining our Posts model
    • Examining our Posts controller
      • Create
      • Search
      • Index
      • New
      • Edit
      • Save
      • Delete
      • Show
    • Examining our Post views
      • Posts layout
      • Index action view
      • Search action view
      • Edit action view
      • New action view
    • Summary
  • Chapter 4: Handling Data in Phalcon
    • Adding models
      • Creating the database tables
      • Generating the models
    • Storing session data in Phalcon
    • Filtering and sanitizing data
    • Phalcon models revisited
    • Using PHQL
    • Switching databases in Phalcon
    • Phalcon's Object-Document Mapper and MongoDB
    • Migrating databases
    • Summary
  • Chapter 5: Using Phalcon's Features
    • Hashing passwords with Phalcon
    • Using Phalcon view helpers
      • Using dynamic title tags
      • Setting the doctype
      • Adding JavaScript and CSS with view helpers
    • Setting cookies
    • Controlling user access
    • Applying the finishing touches to our application
      • Adding comments
      • Adding feeds
    • Sending update pings
    • Using view partials
    • Caching in Phalcon
    • Setting up a cache service
      • Using a Phalcon cache
    • Routing in Phalcon
    • Other project types of Phalcon
      • Multimodule applications
      • Micro applications
      • Command-line applications
    • Summary

Stephan A. Miller

Stephan A. Miller is an SEO specialist, writer, and software developer from Kansas City, MO. He has expertise in operating systems, a few databases, and a handful of programming languages. He is currently working as a software contractor. He is also the author of Piwik Web Analytics Essentials published by Packt Publishing . He also blogs when he has the time at

Sorry, we don't have any reviews for this title yet.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


- 2 submitted: last submission 18 Mar 2014

Errata Type: Support query  Page no: 25

For the next step, composer will use git to pull down the repository for Phalcon Developer Tools, so we need to have it installed. You can use your system’s package manager to install git or download a version of git that will work on your computer at

Errata Type: Code related  Page no: 20

Instead of
//Set up our views
$di->set('view''view', function(){

It should be

//Set up our views
$di->set('view', function(){

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Getting Started with Phalcon +    YUI 2.8: Learning the Library =
50% Off
the second eBook
Price for both: £20.45

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

Learn how to work with Phalcon developer Work with Phalcon Developer Tools to generate application skeletons by building your blog application Understand how PHQL is used to interact with databases like MySQL Handle users, authorization, and session data in your Phalcon web application Discover Phalcon's background tasks and the event manager Create custom templates using the Volt engine Manage your data relationships with Phalcon models

In Detail

Phalcon is an open source PHP framework which makes developing with PHP easier and more efficient by combining the speed and performance of C with the unique development features of the MVC architecture. Phalcon is installed as a PHP module so you don’t have to download an archive like you do with other frameworks, and building projects is made easier with its controllers and models. The Phalcon Query Language (PHQL) makes this tool even more expressive and clean. Its reputation as the most downloaded PHP tool is definitely justified by its rich offerings. This tutorial provides you with the knowledge you need to build your very own web application with the revolutionary Phalcon framework. This comprehensive guide will start by describing the installation of Phalcon PHP. You will then learn how to build projects and how to further utilize the Phalcon Developer Tools to build models, views, and controllers with the central example of a blog application. Features like PHQL are also explained and implemented effectively throughout the book. The genius in you will be revered by the stunning web application that you will be able to create by reading this book. This handy guide gives you a detailed introduction to using the remarkable Phalcon framework to develop web applications. You will begin by learning how to install the Phalcon module and how to build your own projects. The blog application is the central example throughout the book, and by using Phalcon Developer Tools and web tools, you will create and optimize the basic skeleton for your application with ease and efficiency. You will learn how to add rich features to your blog using Phalcon Views, Models, and Controllers. You will also gain expertise in Phalcon functionalities like the Volt template engine, view helpers, PHQL, and so on. This is an invaluable tutorial for enthusiasts and developers alike who wish to use the fascinating Phalcon PHP framework to rapidly design and develop impressive web applications.


This step-by-step, practical guide filled with detailed steps and screenshots will help you discover the Phalcon extension and will enable you to build your blog application with Phalcon quickly and easily.

Who this book is for

If you are a PHP developer with some knowledge and experience of working with PHP and you want to develop stunning web applications easily and quickly, then this book is perfect for you. Learning how to use Phalcon is perhaps the best way to explore the MVC architecture.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software