Getting Started with Phalcon

Getting Started with Phalcon

Language: English

Pages: 138

ISBN: 1783287675

Format: PDF / Kindle (mobi) / ePub

Design, implement, and deliver superior web applications using the most popular PHP framework available

About This Book

  • 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

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.

What You Will Learn

  • 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.

The Art of Debugging with GDB, DDD, and Eclipse

Network Backup with Bacula How-To: Create an autonomous backup solution for your computer network using practical, hands-on recipes

Network Backup with Bacula How-To: Create an autonomous backup solution for your computer network using practical, hands-on recipes

Scrum in Action











But even the simplest application will grow to the point where unique database queries come into play. However, databases are not the only way to handle data in your application. In this chapter, you will learn the following topics: How to use the more advanced features of Phalcon modelsHow to store session data in a Phalcon applicationHow to filter and sanitize our dataHow to replace our MySQL database with another database systemHow to access databases with Phalcon Query Language (PHQL)How to

can sort our comments. And, we have a publish field that we will set to 0 when a comment is submitted, and 1 when we approve the comment. We might possibly need to organize our posts. We have a few options for doing this. We could use categories, where each post must fit into a specific category. Our categories can have child categories, or we can use tags, where each tag can be freely applied to any post, and each post can have more than one tag. Or we can do both, like most blogging

$post){ $post->rss_date = date("D, d M Y H:i:s O", strtotime($post->published)); $rss_posts[] = $post; } $this->view->posts = $rss_posts; $this->view->setRenderLevel(Phalcon\Mvc\View::LEVEL_ACTION_VIEW); } Here, we retrieve only 10 posts ordered by the published date in descending order using Posts::find. As the date format in an RSS feed is very specific and doesn't match the MySQL datetime format, we loop through our records, converting the published date and adding this date to each post

demonstration of the Phalcon framework {{ }} {% for post in posts %} {{ post.title|e }} {{ post.excerpt|e }} {{ }}{{ url("posts/show/" }} {{ }}{{ url("posts/show/" }} {{ post.rss_date }} {% endfor %} We wrap the XML tag at the top of the Volt template tag to hide

file-based backends with Phalcon. As long as you have the required software and PHP extensions installed, you can use any one of the following as a backend cache in Phalcon: FileMemcachedAPCMongoDBXcache Phalcon has a variety of frontend cache adapters too. In the code for our cache service, we specified a data adapter that serializes our data before saving it, but you can also use one of the following frontend adapters: OutputJSONIgBinaryBase64None Using a Phalcon cache Now that we have our

Download sample