Thursday, 26 March 2020 11:50

CodeIgniter MVC , an implementation in a PHP framework

Written by
Rate this item
(0 votes)

Table of Contents:

Introduction

CodeIgniter is a PHP framework, it is good for a small team of programmers (1-2) and you can write very fast applications. Another popular framework is Laravel. There is a special way/pattern to write code the MVC.  This article explains the implementation of MVC in CodeIgniter. CodeIgniter is used a lot in countries like India, Indonesia, and this area. In the western world is used for educational projects. The implementation of MVC in CodeIgniter is easy and good for a newbie to understand.

What is CodeIgniter?

It is a PHP Framework that people use for Educational Apps. A Framework has commands that are a summary of more commands in Vanilla PHP.

Site of CodeIgniter

Follow link

What is CodeIgniter MVC?

It is a pattern that we use in order to manipulate data in some languages like Java, Javascript, PHP e.t.c and it used from some PHP Frameworks like Codeigniter, Laravel e.t.c. MVC it separates the logic layer from the presentation layer.

 

In  CodeIgniter MVC we have three basic classes:

a) Controller (who is doing the management)

b) View (who presents the data)

c) Model (who speaks with the database, in our case MySQL, and fetches the info).

How MVC works:

The browser speaks with the controller.

Then the Controller looks at the Cache if the info exists. If YES controller uses the View to present it ( HTML + CSS + Bootstrap +JS)

If info does not exist, then Controller speaks with Model, Model with Database and returns the info to Controller, the Controller uses the View to present the info to Browser and updates the cache.

 In CodeIgniter, we also use Helpers, Libraries, and all the staff that this framework has. For example, we first must load the Database in order to use it with the specific command or by editing the autoload script.

 

 

Read 1940 times Last modified on Tuesday, 18 June 2024 13:51
Super User

      After Greek Army, I started with QBasic in QL, a computer brother of Spectrum, 2 Degrees, almost 2 Certificates, from GWBasic to Oracle Tech & IBM tech & Solaris Clusters, at almost 60s to CMS tech.

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.