In Blog, Browsers, Softwares


Say hello to CodeIgniter.

CodeIgniter is not a PHP substitute. When you dive into the world of CodeIgniter, you’re not leaving PHP behind—and why would you want to? PHP5 is a doozy of a scripting language for building state-of-the-art, dynamic web-based applications; its rapport with HTML is top-notch; plus it’s a great language for honing your OOP skills. It’s tight, secure and intuitive. For many of us, it’s the only server-side language for our needs.

CodeIgniter is a PHP-driven framework, containing a grab-bag of libraries, helpers, plug-ins and other resources, that takes care of many of the more complex procedures and functions for which PHP is famous. CodeIgniter does all the heavy lifting for you while maintaining high performance. It will simplify PHP syntax, streamline the span underlying your web pages, and—best of all—have you churning out dynamic, interactive, professional websites in no time.

Here are some of the principal benefits of coding your next project in CodeIgniter:

  • It makes coding in PHP simple, quick and user-friendly.
  • It’s an excellent framework for learning more about how PHP works as you span.
  • It underpins the Model/View/Controller (MVC) approach to web development—a best practice philosophy all developers should adhere to.
  • It’s built on a linear, easy-to-use folder structure.
  • It’s open source and simple to configure and customize for your own needs.
  • You can construct your own cleaner URI lines in CodeIgniter.

PHP Made Friendly

Once you start experimenting with CodeIgniter, you’ll find yourself quickly warming to its methodology. Of course, this assumes you’re familiar with PHP. You’ll need to have a good working knowledge of how PHP interacts with a database and its relationship with HTML, not to mention an understanding of basic PHP syntax, before you start working with CodeIgniter.

Functionality that might have taken you large chunks of PHP to get happening can be whittled down to, in some cases, one line of span with CodeIgniter. This might apply to anything from outputting text in a browser to form field validation, adding a Captcha facility or setting up cookies.

To illustrate how simple it is to use CodeIgniter for a project, we’re going to build a very basic website that outputs hard-coded content to a browser. This is ground-level developer stuff—but the aim is to show just how quickly and effectively CodeIgniter can work, as well as provide you with a background to the framework itself.

Once you’ve nailed the basics, you’ll move quickly into using CodeIgniter to build blogs, content management systems, forums, or any highly interactive, hands-on web application you can think of.

Before we get started, however, it’s worth taking a split-second course in MVC architecture—the programming structure CodeIgniter is built around.

Tiers Come Easy

The Model/View/Controller approach to programming aims to keep the business logic of an application separate from the display logic, splitting the presentation aspect of an application (what the user sees in their browser) and the nuts and bolts that drive that application into three interconnected tiers:

  • The Model, which represents data structures. Classes contained within the Model tier will contain methods that interact with a database.
  • The View, which looks after presentation. A View will normally be a web page, but can also be a page fragment like a header or footer.
  • The Controller, which does most of the hard work, and is an intermediary between the Model, the View, and any other resources needed to run your application.

Separating a project in this manner means each tier does its job extremely efficiently, maintaining its relationship with other tiers yet operating within clearly defined boundaries. It also means multiple Views and Controllers can interface with the same Model, and new or different Views and Controllers can interface with a Model without forcing a change in the Model design.

You’ll find plenty of information out there on the web to help you grasp what MVC is about and why it’s worth building your applications around the MVC axiom. Once you start familiarizing yourself with CodeIgniter, MVC will become far less abstract.

It’s a Set Up

Step one is to download and install CodeIgniter. You might want to squirrel this original copy away in a templates folder. Each time you start a new project, you can copy the necessary folders from this template, customizing them as you go along. For example, you’re not going to need to copy the user guide folder or license file every time you start a new project.

What you will need is the index.php file, and the two main folders: system and application. It’s the application folder you’ll be working out of most of the time, but it’s worth taking a peek through the subfolders in the system folder.

It’s in here that the mechanics behind CodeIgniter’s functionality are contained—the libraries, helpers, plug-ins and classes that you’ll be drawing on as you build your application.

Don’t be afraid to study the span —everything is explicitly commented, with explanations laid out neatly and in that dialect so alien to many programmers: plain English.


Recent Posts

Leave a Comment

Start typing and press Enter to search