Category: Tutorials

  • Switching Databases

    We have used a MySQL database in our application. If we wanted to change the database software midstream, it would not be too hard, as long as we have the same data structure in our new database. PostgreSQL Configure the web application which will connect to PostgreSQL database. This can be achieved using the following…

  • Database Connectivity

    In this chapter, we will discuss the database connectivity related to Phalcon. Creation of Database and Design We will focus on creating a database for blogs which maintains posts along with the categories as per the entries of users. Database Name: blog-tutorial Query used for creating the database − After creation of the database, the…

  • Routing

    The router component allows to define routes that are mapped to the controllers or handlers that should receive the request. A router parses a URI as per the information received. Every router in the web application has two modes − The first mode is ideal for working with MVC applications. Following is the syntax to…

  • Views

    Views are information being presented to the end user. A view can be considered as a web page with the appropriate response to be displayed. The response is received through the controller which interacts with the model. Specifically in Phalcon, the view consists of Volt code, PHP and HTML. A set of special delimiters is…

  • Models

    Model in MVC architecture includes the logic of application. Model is the core interaction with the database. It should be able to manage updating, deleting, inserting, and fetching of records as per the user’s request. For understanding the model interaction in Phalcon PHP framework, following steps should be followed. Step 1 − Creation of database. For…

  • Controllers

    In MVC framework, “C” stands for the Controller which refers to the switchboards of the web application. The actions undertaken by the controller, helps to pass parameters to the view so that it can display and respond to the user input accordingly. For example, if we register through a sign-up form which includes details of…

  • Configuration

    The config folder of the web application includes the following files − config.php It includes the configurations for database connectivity and routing as per the directory path. loader.php It extends the existing class of \Phalcon\Loader(). The loader class registers the directories which requires web application. services.php This file associates all the functions which implement the services…

  • Functionality

    Model View Controller (MVC) is a software design and structural pattern for developing webbased applications. This software architectural separates the representation of information from the user’s interaction with it. The MVC model defines the web applications with three logic layers. Model Models are objects which represent knowledge. There should be a one-to-one relationship between the model…

  • Application Structure

    In this chapter, we will discuss the Application Structure of Phalcon. Following is the complete directory structure of a Phalcon project. There is one root folder which is considered as the code base and is publicly available for the web server. It is also called as web directory. Other folders outside the web root directory are considered out…

  • Environmental Setup

    Prerequisites − We need WAMP/LAMP/MAMP or XAMPP stack for this framework. Following are the steps for the installation process of Phalcon framework in Windows. Step 1 − Phalcon installation is completely dependent on dll file. DLL (Dynamic Link Library) creates the required package and plugins for Phalcon. The following link is used for downloading dll file − https://phalconphp.com/en/download Step 2 −…