Author: Awais Farooq
-
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 −…
-
Overview
Phalcon is introduced as one of the recent frameworks of PHP, developed by a group of enthusiastic developers. Phalcon is a loosely coupled framework, which means it allows its objects to be treated like glue components, based on the needs of application. Phalcon offers some unique features in comparison to other frameworks (traditional or existing)…
-
Security
XSS Prevention XSS means cross-site scripting. CodeIgniter comes with XSS filtering security. This filter will prevent any malicious JavaScript code or any other code that attempts to hijack cookie and do malicious activities. To filter data through the XSS filter, use the xss_clean() method as shown below. You should use this function only when you are submitting…
-
Internationalization
The language class in CodeIgniter provides an easy way to support multiple languages for internationalization. To some extent, we can use different language files to display text in many different languages. We can put different language files in application/language directory. System language files can be found at system/language directory, but to add your own language…
-
Adding JS & CSS
Adding JavaScript and CSS (Cascading Style Sheet) file in CodeIgniter is very simple. You have to create JS and CSS folder in root directory and copy all the .js files in JS folder and .css files in CSS folder as shown in the figure. For example, let us assume, you have created one JavaScript file sample.js and…