Preface

This book aims to teach you how to develop web applications efficiently with the Ellis Labs CodeIgniter platform. The CodeIgniter platform is an object-oriented Model-View-Controller development platform. For more on MVC, please refer to http://en.wikipedia.org/wiki/Model-view-controller. The reader of this book is expected to be familiar with at least the PHP programming language, specifically with PHP OOP (object-oriented programming) and its usage, as well as with MySQL.

CodeIgniter (referred to as CI in this book) is an Application Development Framework, a toolkit for people who build websites and web applications using PHP. CodeIgniter is a smart application development skeleton framework, with flexible and expandable core powered high performance and low footprint. The CodeIgniter framework (OSL 3.0 open source license), developed and maintained by Ellis Labs, powers an echo system of developers across the globe. The first public version of CodeIgniter was released on February 28, 2006. It got very good feedback from web application professional developers. During November 2010, the CodeIgniter development project was added to the well-known GitHub community projects, and got increasing interest and usage by developers worldwide, as well as more and more third parties providing more add-ons with a better maturity and functionality set.

There is a rising trend of web applications based on OOP (object-oriented programming) frameworks using MVC (Model-View-Controller) development patterns, described in the next section, for developing advanced web applications. CodeIgniter is such a framework. 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 (including views/controllers/models/libraries/helpers providing application-oriented solutions such as CMS, shopping carts, or table grid navigators) and add-ons of libraries/helpers are becoming available.

The MVC concept is a development pattern or an application framework for a computer user interface that separates the representation of information from the user interacting with it. MVC has been adopted as a successful architecture for web application developments. The model consists of application data and provides services to manipulate them. The controller handles business rules and executes requests to the models and views. The controller mediates between the input, mostly received from a user interacting with a web browser that executed the rendered view. The browser runs a received rendered view by the controller through an HTTP protocol. The controller is the heart of the application. It performs model/database updates, business logic calculations, renders views to the user, and responds to an asynchronous AJAX (Asynchronous JavaScript and XML) request sent from the client side. The view code defines the presentation and user input logic to be rendered by the controller as HTML and JavaScript to the browser. The browser receives the rendered view via the HTTP response to be executed locally. The browser executing that content can present data, such as a mix of text, charts, diagrams, and images.

There are legacy CMS (Content Management System) web development platforms focused on CMS functionality and maintenance, such as a mature platform named DRUPAL. It might be very useful for content-oriented projects, but less appealing if the project aims to develop a new rich set of functionality, that is, web apps with many inputs and customized UI operations. If the project's requirements involve a low footprint and fast response/high performance, CodeIgniter is found to have excellent results.

To sum up in terms of flexibility, code reusability, light infrastructure, enabling developer creativity, code clarity, highest performance, minimal footprint, and fast learning curve, CodeIgniter seems to be the best choice. Furthermore, it is part of a proactive improvement process thanks to the growing developer's community worldwide.

What this book covers

Chapter 1, Getting Started, introduces the CodeIgniter framework, while initially getting started with web-based applications.

Chapter 2, Configurations and Naming Conventions, reviews the CI naming convention rules, style guide, and spirit as well as the mandatory and optional configurations and usage within a CI project, with several examples. The practice of user-defined configurations will be reviewed as well.

Chapter 3, Controllers, reviews the CI controller and the user-defined controllers extending the CI controller. The CI controller class services, role, definition, usage, and scope will be reviewed with several examples to clarify.

Chapter 4, Libraries, reviews the user-defined libraries in a CI framework. Their services, role, definition, usage, and scope will be reviewed with several examples to clarify. Several examples for defining libraries and using them will be provided.

Chapter 5, Helpers, introduces you to the CI helpers and user-defined helpers' reusability value, definition rules, scope, and usage. Several examples for defining helpers and using them will be provided.

Chapter 6, Models, covers CI models and user-defined models' reusability value, definition rules, scope, and usage. Several examples for defining the models, extending the CI model, and using them will be provided.

Chapter 7, Views, explains the CI views concept as the generators for the client-side visualization and user interaction provided via HTTP. The view of the PHP part and scope, visual content (HTML/CSS), and program (JavaScript/AJAX/jQuery) for the client browser will be reviewed. The view's scope, definition, and controller rendering guidelines with practical practice and tips and tricks will be covered in this chapter.

Appendix, Appendix References, refers to recommended external resources related to CodeIgniter's formal resources as well as the ECHO system of the developer's community.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.181.36