Table of Contents
Preface
Chapter 1: Introduction to CodeIgniter
Chapter 2: Two Minutes' Work: Setting up a CodeIgniter Site
Chapter 3: Navigating Your Site
Chapter 4: Using CI to Simplify Databases
Chapter 5: Simplifying HTML Pages and Forms
Chapter 6: Simplifying Sessions and Security
Chapter 7: CodeIgniter and Objects
Chapter 8: Using CI to Test Code
Chapter 9: Using CI to Communicate
Chapter 10: How CI Helps to Provide Dynamic Information
Chapter 11: Using CI to Handle Files and Images
Chapter 12: Production Versions, Updates, and Big Decisions
Chapter 13: Instant CRUD—or Putting it All Together
Chapter 14: The Verdict on CI
Chapter 15: Resources and Extensions
Index
- Chapter 1: Introduction to CodeIgniter
- What can CodeIgniter Do for You?
- Save Time
- Make Your Site More Robust
- Keep Your Links Up-To-Date Automatically
- Save Database Crashes: 'prep' Your Data Entry Forms
- Make Your Code Bolder
- Send Email Attachments without Hassles
- Save Bandwidth by Zipping Files That Users Need to Download
- Yes, But…What is CodeIgniter? What are Frameworks?
- And Who is That Man?
- The 'Open Source' Business Model
- What CI Doesn't Do
- License
- Summary
- What can CodeIgniter Do for You?
- Chapter 2: Two Minutes' Work: Setting up a CodeIgniter Site
- Prerequisites
- Installing CodeIgniter
- Exploring the File Structure
- The Configuration File
- Does it Work?
- Summary
- Chapter 3: Navigating Your Site
- MVC—Just Another Acronym?
- The Structure of a CI Site: Controllers and Views
- The Welcome Controller
- Working with Views
- The Default Controller
- CodeIgniter Syntax Rules
- Controller
- View
- Types of Files or Classes on a CI Site
- What are All Those Folders For?
- Designing a Better View
- Designing a Better Controller
- Getting Parameters to a Function
- Passing Data to a View
- How CI Classes Pass Information and Control to Each Other
- Calling Views
- Calling Functions Directly
- Interacting with Controllers
- It's Just Like an Egg-Cup
- An Example of a CI Helper: the URL Helper
- A Simple Library Example: Creating a Menu
- Summary
- Chapter 4: Using CI to Simplify Databases
- Configuration Settings
- Designing the Database for Our Site
- Active Record
- Advantages of Using the Active Record Class
- Saving Time
- Automatic Functionality
- Read Queries
- Displaying Query Results
- Create and Update Queries
- Delete Queries
- Mixing Active Record and 'Classic' Styles
- Advantages of Using the Active Record Class
- Summary
- Chapter Appendix: MYSQL Query to Set Up 'websites' Database
- Chapter 5: Simplifying HTML Pages and Forms
- Writing a View
- Long and Short PHP Syntax
- Nesting Views
- Practical Issues of Site Architecture
- CI's Form Helper: Entering Data
- Form Helper Advantage One: Clarity
- Form Helper Advantage Two: Automation
- My 'Display' Model
- CI's Validation Class: Checking Data Easily
- Set Up Validation
- Set Up the Controller
- Set Up the Forms
- Summary
- Chapter 6: Simplifying Sessions and Security
- Starting to Design a Practical Site with CI
- Moving Around the Site
- Security/Sessions: Using Another CI Library Class
- Turning Sessions into Security
- Security
- Summary
- Chapter 7: CodeIgniter and Objects
- Object-Oriented Programming
- Working of the CI 'Super-Object'
- Copying by Reference
- Adding Your own Code to the CI 'Super-Object'
- Problems with the CI 'Super-Object'
- Summary
- Object-Oriented Programming
- Chapter 8: Using CI to Test Code
- Why Test, and What For?
- CI's Error Handling Class
- CI's Unit Test Class
- When to Use Unit Tests
- Example of a Unit Test
- CI's Benchmarking Class
- CI's Profiler Class
- Testing with Mock Databases
- Control and Timing
- Summary
- Chapter 9: Using CI to Communicate
- Using the FTP Class to Test Remote Files
- Machines Talking to Machines Again—XML-RPC
- Getting the XML-RPC Server and Client in Touch with Each Other
- Formatting XML-RPC Exchanges
- Debugging
- Issues with XML-RPC?
- Talking to Humans for a Change: the Email Class
- Summary
- Chapter 10: How CI Helps to Provide Dynamic Information
- The Date Helper: Converting and Localizing Dates
- Working with Text: the Text Helper and Inflector Helper
- Going International: the Language Class
- Making HTML Tables the Easy Way: the Table Class
- Caching Pages
- Summary
- Chapter 11: Using CI to Handle Files and Images
- The File Helper
- The Download Helper
- The File Upload Class
- CI's Image Class
- Easy File Compression with the CI Zip Class
- Summary
- Chapter 12: Production Versions, Updates, and Big Decisions
- Connections: Check the Config Files
- URLs
- Databases
- Other config Files
- Look Out for PHP 4/5 and Operating System Differences
- Diagnostic Tools
- Coping with Changes in New CI Versions
- How to Load Models, and What to Call Them
- How to Initialize Your Own 'library' Classes
- So Should I Update If a New CI Version Comes Out?
- How to Add On to CI's Basic Classes
- Summary
- Connections: Check the Config Files
- Chapter 13: Instant CRUD—or Putting it All Together
- The CRUD Model: Design Philosophy
- The Standard Controller Format
- The Database Tables
- The Heart of the Model: the Array
- Function by Function: the CRUD Model
- Showall
- Reading the Data
- Delete and Trydelete
- Insert
- Insert2
- The Test Suite
- Showall
- Summary
- Chapter 14: The Verdict on CI
- Some Code: the 'do_test' Model
- A Balance Sheet
- Where CI Helped: Structure
- Where CI Helped: Simplicity
- Where CI Helped: Extra Functionality
- Problems with CI
- Completeness
- Ease of Use
- Summary
- Chapter 15: Resources and Extensions
- CI's User Forums
- Video Tutorials
- Available Plug-ins and Libraries
- AJAX/Javascript
- Authentication
- External Sites
- Comparisons: Which Charting Library to Use?
- CRUD: the Final Frontier
- Resources for Other Programmes, e.g. Xampplite, MySQL, PHP
- Summary