What is Phalcon
Phalcon is developed by group of developers where Andres Gutierrez was their team head. Phalcon is an open-source framework of PHP programming language. It is based on Module View Controller (MVC) pattern. Phalcon is the first framework that implements ORM in C-programming language.
Phalcon Application Structure
Phalcon key feature is that it is a loosely coupled framework. Phalcon allows user to build project with a directory structure that is convenient for specific application. It follows MVC and has "Standard Structure". Phalcon has the following directory structure for a project:
Application: It contains the config, controllers and views resource folder. This directory defines all the functionality of an application. It consists of vital scripts and files which runs on the server.
Configuration: It defines the configuration properties of the application. It consists of four files:
Controllers: All the methods defined under controllers handle the requests. By default all the methods on the controller are map to actions.
Views: It represents the user interface of your application. Views consist of html files embedded with PHP code that perform task accordingly.
Cache: It is a class under Phalcon directory which allows faster access to frequently used data. This class is written in C programming language. It provides high performance and reduced overhead.
Phalcon MVC (Model View Controller) Architecture
Phalcon consist of object oriented classes to implement MVC architecture. MVC is a framework which is used to develop web frameworks and desktop applications. Some advantages are:
Model represents the data or information of the application. Most of the business logic of our application is in model. It describes the rules to manipulate the data. It helps in interaction with the database table. In most cases each table corresponds to one model in our application.
It represents the user interface of our application. Views consist of HTML pages and PHP code embedded within to perform different tasks. It handles the requests generated by your application by providing data to the web-browser.
It provides the flow between model and view. It processes the requests from the web-browser then re-checks from model and delivers the result to the views.