Book Image

CodeIgniter 1.7 Professional Development

By : Adam Griffiths
Book Image

CodeIgniter 1.7 Professional Development

By: Adam Griffiths

Overview of this book

<p>CodeIgniter is an open source PHP framework with a small footprint and exceptional performance. It gives you a rich set of libraries for common tasks, with a simple interface to access them. There are several unexplored aspects of CodeIgniter that can help developers build applications more easily and quickly. In this book, you will learn the intricacies of the framework and explore some of its hidden gems.<br /><br />If you want to get the most out of CodeIgniter, this book is for you. It teaches you what you need to know to use CodeIgniter on a daily basis. You will create mini-applications that teach a specific technique and let you build on top of the base. <br /><br />This book will take you through developing applications with CodeIgniter. You will learn how to make your CodeIgniter application more secure than a default installation, how to build large-scale applications and web services, how to release code to the community, and much more. You will be able to authenticate users, validate forms, and also build libraries to complete different tasks and functions.<br /><br />The book starts off introducing the framework and how to install it on your web server or a local machine. You are introduced to the Model-View-Controller design pattern and how it will affect your development. Some important parts of the CodeIgniter Style Guide are included to keep CodeIgniter development as standardized as possible; this helps greatly when working as part of a team or taking on an old CodeIgniter project. You will quickly move on to how CodeIgniter URLs work and learn about CodeIgniter-specific files such as helpers and plugins. By the time you finish this book, you will be able to create a CodeIgniter application of any size with confidence, ease, and speed.</p>
Table of Contents (16 chapters)
CodeIgniter 1.7 Professional Development
Credits
About the Author
About the Reviewers
Preface
Index

Downloading and installing CodeIgniter


This book assumes prior knowledge of PHP—this should also stretch to a web server. CodeIgniter needs a web server to run on, just like any other PHP application. You can install CodeIgniter locally just for testing, or use it on your current web server; anywhere will suffice.

Getting the CodeIgniter files

The first step to getting started with CodeIgniter is to download the files from the website. The website is located at www.codeigniter.com. This website includes a backlog of all of the previous versions of CodeIgniter, as well as a Subversion Repository (SVN) for the latest version. In our case, we can simply download the latest version straight from the home page—currently 1.7.2— by clicking on the Download CodeIgniter button, as seen in the next screenshot.

When you have downloaded the ZIP file, unzip it using your favourite file archiving program. You will now have a folder named CodeIgniter_1.7.2. The folder should contain two files and two directories, as seen in the next screenshot.

The system directory holds the core CodeIgniter files, libraries, and other CI specific stuff, such as the logs and cache directories. It also houses the application folder—this is the only folder you truly need to worry about, as this is the only place where you need to put your files. As you can guess, this is the folder where all your application-specific code goes, and includes the configuration files that you may need to edit.

Simply open this folder in your code editor of choice and we'll go ahead and install CodeIgniter in our final step. We need to edit the base URL—the URL at which you will you access your application—and to do this we need to open the file /system/application/config/config.php. The value that we need to change is the array item $config['base_url'] which is currently set to http://example.com/—simply change this to your URL.

Tip

The base URL value needs to have a trailing slash (a forward slash) at the end.

When that is done, navigate to your base URL and you should see the CodeIgniter welcome screen, as seen in the next screenshot.