售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
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 works…
Building an appointment manager with Calendar Library
Getting ready
How to do it…
How it works…
The public function create()
The public function delete()
Creating a helper to work with a person's date of birth
How to do it…
How it works…
Working with fuzzy dates in CodeIgniter
How to do it…
How it works…
9. Extending the Core
Introduction
Using CodeIgniter Sparks
Getting ready
How to do it...
How it works...
Creating PDFs with the DOMPDF Spark
Getting ready
How to do it...
How it works...
Creating Hooks in CodeIgniter
Getting ready
How to do it...
Clearing dead sessions from the database
Getting ready
How to do it...
How it works...
Extending your controllers
How to do it...
How it works...
Uploading a file with FTP
Getting ready
How to do it...
How it works...
Creating libraries and giving them access to CodeIgniter resources
Getting ready
How to do it...
How it works...
Making your own configuration files and using the settings
How to do it...
How it works...
Using the language class – switching language on the go
Getting ready
How to do it...
How it works...
10. Working with Images
Introduction
Installing ImageMagick on MAC with Cactuslab
How to do it...
How it works...
Uploading images with CodeIgniter
How to do it...
How it works...
Generating thumbnails – resizing
Getting ready
How to do it...
How it works...
Rotating images
Getting ready
How to do it...
How it works...
Cropping images
Getting ready
How to do it...
How it works...
Potential errors
Adding watermarks with text
Getting ready
How to do it...
How it works...
Adding watermarks with image overlays
Getting ready
How to do it...
How it works...
Submitting a form with CodeIgniter CAPTCHA
Getting ready
How to do it...
How it works...
11. SEO, Caching, and Logging
Introduction
Using SEO-friendly URLs in CodeIgniter
How to do it...
How it works...
Using CodeIgniter caching
How to do it...
How it works...
Problems you may encounter
Logging errors with CodeIgniter
Getting ready
How to do it...
How it works...
Logging style
Benchmarking your application
Getting ready
How to do it...
How it works...
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜