Book Image

Getting Started with Phalcon

By : Stephan A. Miller
Book Image

Getting Started with Phalcon

By: Stephan A. Miller

Overview of this book

<p>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.</p>
Table of Contents (12 chapters)
Getting Started with Phalcon
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

The developers of Phalcon made it their mission to develop the fastest and most efficient PHP framework around, and they have done a good job of completing that mission. With the speed of C programming, simplicity of PHP, and the structure of a framework, Phalcon streamlines web application development.

Getting Started with Phalcon is an introduction to using Phalcon to develop web applications. You will learn by building a blog application using Phalcon Developer Tools and web tools to flesh out the CRUD skeleton for the application quickly, and then modifying it to add features.

As features are added to the blog, you will learn how to use other Phalcon functionalities such as the Volt template engine, view helpers, PHQL, validation, encryption, cookies, sessions, and event management.

What this book covers

Chapter 1, Installing Phalcon, covers installing the Phalcon PHP extension on Linux, Windows, or Mac, and configuring PHP, Apache, or Nginx.

Chapter 2, Setting Up a Phalcon Project, covers setting up a project in Phalcon manually using Phalcon Developer Tools or Phalcon web tools.

Chapter 3, Using Phalcon Models, Views, and Controllers, covers the MVC structure of Phalcon.

Chapter 4, Handling Data in Phalcon, covers Phalcon Models in depth, PHQL, session data, and filtering and sanitizing data.

Chapter 5, Using Phalcon's Features, covers even more features in Phalcon, including hashing passwords, controlling user access, setting cookies, and using view partials, logging, and view helpers.

Who this book is for

This book is intended for PHP developers who want to learn how to use the Phalcon PHP framework. Some knowledge of PHP but no prior knowledge of MVC frameworks is required.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, path names, dummy URLs, user input, and Twitter handles are shown as follows: "So, we have to locate the php.ini file and edit it."

A block of code is set as follows:

phalconBlog/
  app/
    config/
    controllers/
    library/
    logs/
    models/
    plugins/
    views/
      index/
      layouts/
  public/
    css/
    files/
    img/
    js/
    temp/

Any command-line input or output is written as follows:

sudo apt-get install git
sudo apt-get php5-devphp-mysqlgcc

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "So, search for the word Compiler in your browser window."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title through the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you. You can also find all the code used in the book by visting GitHub page http://eristoddle.github.io/phalconBlog/.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.