Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
CodeIgniter 1.7

You're reading from   CodeIgniter 1.7 Improve your PHP coding productivity with the free compact open-source MVC CodeIgniter framework!

Arrow left icon
Product type Paperback
Published in Nov 2009
Publisher Packt
ISBN-13 9781847199485
Length 300 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (21) Chapters Close

CodeIgniter 1.7
Credits
About the Authors
About the Reviewer
1. Preface
1. Introduction to CodeIgniter FREE CHAPTER 2. Setting up a CodeIgniter Site 3. Navigating Your Site 4. Using CI to Simplify Databases 5. Simplifying HTML Pages and Forms 6. Simplifying Sessions and Security 7. CodeIgniter and Objects 8. Improving Our Application with Third-Party Code 9. Using CI to Communicate 10. How CI Helps to Provide Dynamic Information 11. Using CI to Handle Files and Images 12. Moving Your Site to the WWW 13. CRUD—or Putting It All Together 14. The Verdict on CI 15. Resources and Extensions Appendix

Chapter 7. CodeIgniter and Objects

In this chapter we will see how CodeIgniter actually works, "under the hood". This chapter will help us understand why things happen in certain ways, as opposed to just knowing that they do.

Objects confused us, when we started using CodeIgniter. Coming to CodeIgniter through PHP 4, which is a procedural language, and not an object-oriented (OO) language. We duly looked up objects and methods, properties and inheritance, and encapsulation, but our early attempts to write CI code were plagued by the error message "Call to a member function on a non-object". We saw it so often that we were thinking of having it printed on a T-shirt.

To save the world from a lot of boring T-shirts, this chapter covers the way in which CI uses objects, and the different ways you can write and use your own objects. Incidentally, we've used "variables/properties", and "methods/functions" interchangeably, as CI and PHP often do. You write "functions" in your controllers, for instance...

lock icon The rest of the chapter is locked
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
CodeIgniter 1.7
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon