CodeIgniter 2 Cookbook
eBook - ePub

CodeIgniter 2 Cookbook

  1. 306 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

CodeIgniter 2 Cookbook

Book details
Book preview
Table of contents
Citations

About This Book

In Detail

As a developer, there are going to be times when youll need a quick and easy solution to a coding problem. CodeIgniter is a powerful open source PHP framework which allows you to build simple yet powerful full-feature web applications.

CodeIgniter 2 Cookbook will give you quick access to practical recipes and useful code snippets which you can add directly into your CodeIgniter application to get the job done. It contains over 80 ready-to-use recipes that you can quickly refer to within your CodeIgniter application or project.

This book is your complete guide to creating fully functioning PHP web applications, full of easy-to-follow recipes that will aid you in any aspect of developing with CodeIgniter. CodeIgniter 2 Cookbook takes you from the basics of CodeIgniter, through e-commerce features for your applications, and ends by helping you ensure that your environment is secure for your users and SEO friendly to draw in customers.

Starting with installation and setup, CodeIgniter 2 Cookbook provides quick solutions to programming problems that you can directly include in your own projects. You will be moving through databases, EU Cookie Law, caching, and everything else in-between with useful, ready-to-go recipes. You will look at image manipulation using the Image Manipulation library, user management (building a simple CRUD interface), switching languages on the fly according to the user preference, caching content to reduce server load, and much more.

Approach

Presented in a recipe-based format, you are led step-by-step through each aspect of CodeIgniter, allowing you to dip in and out as you choose.

Who this book is for

CodeIgniter 2 Cookbook is for intermediate to advanced PHP developers who want to begin using the powerful CodeIgniter framework to create web applications. Familiarity with CodeIgniter isnt essential, but it will be useful if you have been introduced to the framework before.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access CodeIgniter 2 Cookbook by Rob Foster in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in PHP. We have over one million books available in our catalogue for you to explore.

Information

Year
2013
ISBN
9781782162308

CodeIgniter 2 Cookbook


Table of Contents

CodeIgniter 2 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. CodeIgniter Basics
Introduction
Downloading and installing CodeIgniter
How to do it...
Basic configuration options
How to do it...
How it works...
Managing CodeIgniter on different environments
How to do it...
How it works...
Managing database settings on different environments
How to do it...
How it works...
Common values
Other values
Securing the system files
How to do it...
How it works...
Removing index.php from the address bar using .htaccess
How to do it...
How it works...
Installing and using Sparks
How to do it...
How it works...
2. User Management
Introduction
Database schema
Viewing users
How to do it...
How it works...
Creating users
How to do it...
How it works...
Editing users
How to do it...
How it works...
Deleting users
How to do it…
How it works...
Generating passwords with CodeIgniter
Getting ready
How to do it...
How it works...
Generating passwords with CodeIgniter – the bare bones
How to do it...
Generating a hash
Comparing hashed values
How it works...
Forgot password? – resetting passwords with CodeIgniter
Getting ready
How to do it...
How it works...
3. Creating E-commerce Features
Introduction
Amending configuration settings to run sessions in a database
Getting ready
How to do it...
How it works…
Categories table
Products table
Creating a basic cart
How to do it...
How it works...
User browses the catalogue
User adds an item to the cart
User updates or removes items in the cart
Adding and searching by product categories
Getting ready
How to do it...
How it works...
Saving the cart to the database
How to do it...
How it works...
4. Email, HTML Table, and Text Libraries
Introduction
Sending plain e-mails with CodeIgniter Email
How to do it...
How it works...
Sending HTML e-mails with CodeIgniter Email
How to do it...
How it works...
Sending attachments with CodeIgniter Email
How to do it...
How it works...
Sending bulk e-mails with CodeIgniter Email
Getting ready
How to do it...
How it works...
Using an HTML table with DataTable
Getting ready
How to do it...
How it works...
Using an HTML table with DataTable and a database
Getting ready
How to do it...
How it works...
Using word_limiter() for table output
Getting ready
How to do it...
How it works...
Using word_censor() for cleaning input
Getting ready
How to do it...
How it works...
5. Managing Data In and Out
Introduction
Sending different data to multiple views
Getting ready
How to do it...
How it works...
Validating user input
Getting ready
How to do it...
How it works...
Preparing user input
How to do it...
Sticky form elements in CodeIgniter
Getting ready
How to do it...
How it works...
Displaying errors next to form items
How to do it...
How it works...
Reading files from the filesystem
Getting ready
How to do it...
How it works...
Writing files to the filesystem
How to do it...
How it works...
Creating and downloading ZIP files
How to do it...
How it works...
Uploading files with CodeIgniter
Getting ready
How to do it...
How it works...
There's more...
Creating and using validation callbacks
How to do it...
How it works...
Using the language class
Getting ready
How to do it...
How it works...
Confirming cookie acceptance from the user
Getting ready
How to do it...
How it works...
There’s more...
6. Working with Databases
Introduction
Configuring CodeIgniter for databases
How to do it...
How it works...
Connecting to multiple databases
Getting ready
How to do it...
How it works...
Active Record – create (insert)
Getting ready
How to do it...
How it works...
The public function create()
The public function create_batch()
Active Record – read (select)
Getting ready
How to do it...
How it works...
Active Record – update
Getting ready
How to do it...
How it works...
ActiveRecord – delete
Getting ready
How to do it...
How it works...
Looping through the database results
Getting ready
How to do it...
How it works...
Counting the number of returned results with num_rows()
How to do it...
How it works...
Counting the number of returned results with count_all_results()
How to do it...
Query binding
Getting ready
How to do it...
How it works
Finding the last insert id
How to do it...
How it works...
Finding the number of affected rows
How to do it...
How it works...
Finding the last database query
How to do it...
How it works...
Using CodeIgniter database migrations
Getting ready
How to do it...
Moving to the current version with current()
Getting ready
How to do it...
How it works...
Rolling back/stepping forward with version()
Getting ready
How to do it...
How it works...
Generating an XML from a database result
Getting ready
How to do it...
How it works...
Generating a CSV from a database result
Getting ready
How to do it...
Forcing download
How it works...
Saving to file
How it works...
There's more...
7. Creating a Secure User Environment
Introduction
Escaping user input
Getting ready
How to do it...
Globally
Individually
How it works...
Preventing cross-site request forgery
How to do it...
How it works...
Escaping data – for a database
Getting ready
How to do it...
How it works...
There's more...
Using HTTPS with CodeIgniter
Getting ready
How to do it...
How it works...
There's more...
Setting up HTTPS on localhost
8. Calendaring, Right Place, and Right Time
Introduction
Building a CodeIgniter Calendar helper with database results
Getting ready
How to do it…
How it w...

Table of contents

  1. CodeIgniter 2 Cookbook