CodeIgniter MVC – The Power of Simplicity!

Exclusive offer: get 50% off this eBook here
Programming with CodeIgniter MVC

Programming with CodeIgniter MVC — Save 50%

Build feature-rich web applications using the CodeIgniter MVC framework with this book and ebook

$20.99    $10.50
by Eli Orr Yehuda Zadik | November 2013 | PHP Web Development

In this article by Eli Orr and Yehuda Zadik, the authors of the book Programming with CodeIgniter MVC, the authors would like to share with you initially, his personal wisdom based on many years of experience with various technologies, where CI fits well to my wisdom conclusion. In the last 30 years I was deeply in many software development projects in the rule of a lead developer, system architect, and product manager. One common conclusion I have found, is:

(For more resources related to this topic, see here.)

"Simplicity Wins In Big!"

Back in the 80s there was a programming Language ADA that according to many contracts was required to be used. ADA was so complex and hard compared to C/C++ to maintain. Today ADA fades like Pascal.

C/C++ is the simplicity winner for real time systems arena.

In Telecom for network devices management protocols there were two standards in the 90s: CMIP (Common Management Information Protocol) and SNMP (Simple Network Management Protocol). Initially (90s) all telecom Requirement Papers required CMIP support. Eventually after several years a research found that there's about 1:10 or 10x effort to develop and maintain a same system based CMIP compared to SNMP.

SNMP is the simplicity winner in network management systems arena!

In VoIP or Media over IP, the H.323 and SIP (Session Initiation Protocol) were competing protocols in early 2000. H.323 had the messages in a cryptic binary way. SIP makes it all textual XML fashioned, easy to understand via text editor. Today almost all end point devices powered SIP while H.323 becomes a niche protocol for the VoIP backbone. SIP is the simplicity winner in VoIP arena!

Back in 2010 I was looking for a good PHP platform to develop Web Application for my startup 1st product Logodial Zappix (http://zappix.com).

I got a recommendation to use DRUPAL for this. I've tried the platform and found it very heavy to manipulate and change for my exact user interaction flow and experience I had in mind. Many times I had to compromise and the overhead of the platform was indeed horrible. Just make Hello world App and tons of irrelevant code will get into the project. Try to make free JavaScript and you found yourself struggling with the platform disabling you from the creativity of client side JavaScript and its Add-ons. I've decided to look for a better platform for my needs.

Later on I've heard about Zend Framework MVC (Model-View-Controller framework typed). I've tried to work with it as it is based MVC and a lot of OOP usage, but I've found it heavy... Documentation seems great at first sight, but the more I've used I, looking for vivid examples and explanations, I found myself in endless close circle loops of links.

It was lacking a clear explanation and vivid examples.

The filling was like every match box moving task, I'd required a semi-trailer of declarations and calls to handle making it... Though it was MVC typed which I greatly liked.

Keeping on with my search, I was looking for simple but powerful MVC based PHP which is my favorite language for server side.

One day in early 2011 I got a note from a friend that there's a light and cool platform named CodeIgniter (CI in brief). I've checked the documentation link http://ellislab.com/codeigniter/user-guide/ and was amazed from the very clean, simple, well organized and well explained browsing experience.

Having Examples? Yes, lots of clear examples, with great community. It was so great and simple. I felt like those platform designers were doing the best effort to make the simplest and most vivid code, reusable and clean OOP fashion from the infrastructure to the last function. I've tried making web app for a trail, trying to load helpers, libraries and use them and greatly loved the experience.

Fast forward, today I see a matured CodeIgniter as a Lego like playground that I know well. I've wrote tons of models, helpers, libraries, controllers and views. CodeIgniter Simplicity enables me to do things fast and, clear and well maintained and expandable. In time I've gathered the most useful helpers and libraries, Ajax server and Browser side solutions for reuse, good links to useful add on such as the free Grid Powered Plug-In for CI the http://www.grocerycrud.com/ that keep improving day by day.

Today I see Codeigniter as a matured scalable (See at&t and sprint Call Center Web apps based CI), reusability and simplicity champion.

The following is the high-level architecture of the Codeigniter MVC with the Controller/s as the hub the application session.

The CI controller main use cases are:

  • Handles requests from web browser as HTTP URI call, based on submitted parameters (for example Submitting a Login with the credentials) or with no-parameters (for example Home Page navigation).
  • Handles Asynchronous Ajax requests from the Web Client mostly as JSON HTTP POST request and response.
  • Serving CRON job requests that creates HTTP URI request, calling controller methods, similar to browser navigation, silently from the CRON PHP module.

The CI Views main features:

  • Rendered by a controller with optionally set of parameters (scalar, arrays, objects)
  • Has full open access to all the helpers, libraries, models as their rendering controller has.
  • Has the freedom to integrate any JavaScript / 3rd party Web Client side plug-ins.

The CI helper/s main features and fashion:

  • Flat functions sets protected from duplication risks
  • Can be loaded for use by any controller and accessed by any rendered view.
  • Can access any CI resource / library and others via the &get_instance() service.

The CI Libraries main features and fashion:

  • OOP classes that can expand other 3rd party classes (For example, see the example of the Google Map wrapper in the new Book).
  • Can access any of the CI resources of other libraries, built-in services via the &get_instance().
  • Can be used by the CI project controllers and all their rendered views.

The CI Model main features and fashion:

  • Similar to Libraries but has access to the default database, that can be expanded to multi databases and any other CI resource via the &get_instance().
  • OOP classes that can expand other 3rd party classes (For example, See the example of the Google Map wrapper in the new Book).
  • Can access any of the CI resources of other libraries, built-in services via the &get_instance().

It seems that CodeIgniter is continuously increasing its popularity as it has a simple yet high quality OOP core that enables great creativity, reusability, and code clarity naming conventions, which are easy to expand (user class extends CI class), while more third-party application plugins (packages of views and/or models and/or libraries and/or helpers).

I found Codeigniter flexible, great reusability enabler, having light infrastructure, enables developer creativity powered active global community.

For a day to day the CI code clarity, high performance capabilities, minimal controllable footprint (You decide what helpers/libraries/models to load for each controller).

Above all CI blessed with very fast learning curve of PHP developers and many blogs and community sites to share knowledge and raise and resolve issues and changes.

CodeIgniter is the simplicity winner I've found for Web Apps MVC Server side.

Summary

This article introduces the CodeIgniter framework, while initially getting started with web-based applications.

Resources for Article:


Further resources on this subject:


Programming with CodeIgniter MVC Build feature-rich web applications using the CodeIgniter MVC framework with this book and ebook
Published: September 2013
eBook Price: $20.99
Book Price: $34.99
See more
Select your format and quantity:

About the Author :


Eli Orr

Eli Orr brings over 30 years of experience in the high tech industry, mainly in software product development. Eli published articles in several magazines such as Wireless Systems Design, Telephony-Online, CommsDesign, EE Times, and for various emerging technologies. Currently, Eli is a PHP Advanced Web Application Developer, focused on CodeIgniter based projects for the last two years for rich functionality heavy-duty web applications.

Prior to that, as an entrepreneur, Eli established LogoDial Zappix Ltd., and had the role of CTO and server-side developer. Zappix enables dynamic visualization of call center voice menus, which are currently available in USA and Israel on iOS and Android-enabled smartphones.

Prior to that, Eli developed telecom solutions for Unified Communications with AT&T. Prior to that, Eli developed VoIP developer toolkits as a product manager with Radvision Ltd. During that period, he was an active member with the ITU-T Signaling Group 16 for defining VoIP protocol standardization, mainly the H.323.

Prior to that, Eli led development teams with IAI (Israel Aircraft Industries) ELTA based C and C++ programming languages. Eli can be contacted through his website, http://EliOrr.com.

Yehuda Zadik

Yehuda Zadik has over 20 years of experience in the IT industry, where he mainly specialized in software development based object-oriented programming
(OOP) technologies.

Yehuda has over 8 years of experience developing with PHP OOP and open source Linux environments for developing web-based applications. Yehuda used state-of-the-art technologies for building dynamic web-based applications that were e-commerce enabled as well as social network integrated. Yehuda has a vast knowledge for integrating third-party plugins for network, mobile, and social environments' integration. Among the environments, Yehuda integrated with Facebook API, LinkedIn API, and various others.

Yehuda is an enthusiastic CodeIgniter developer who has been developing rich functionality and heavy traffic web-based applications over the last two years. Among Yehuda's clients are several major academic institutes. Yehuda can be contacted through his website, http://yudazdk.co.il.

Books From Packt


 CodeIgniter for Rapid PHP Application Development
CodeIgniter for Rapid PHP Application Development

CodeIgniter 1.7
CodeIgniter 1.7

 CodeIgniter 1.7 Professional Development
CodeIgniter 1.7 Professional Development

 Catalyst 5.8: the Perl MVC Framework
Catalyst 5.8: the Perl MVC Framework

 ASP.NET MVC 1.0 Quickly
ASP.NET MVC 1.0 Quickly

 Learning JavaScriptMVC
Learning JavaScriptMVC

ASP.NET MVC 2 Cookbook
ASP.NET MVC 2 Cookbook

Sencha MVC Architecture
Sencha MVC Architecture


Your rating: None Average: 2.9 (7 votes)

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
j
d
U
k
9
6
Enter the code without spaces and pay attention to upper/lower case.
Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software