There are certain components (helpers, libraries, etc.) that we probably will use all along our application. So instead of loading a component every time we use it, we can autoload it every time our application works. Let's see how simple this behavior is.
- [Voiceover] CodeIgniter lets us load certain resources…every time our application loads.…This is called autoloading.…It is very useful for when we need certain libraries,…helpers, or even models.…We can also load language files or drivers.…Let's see a few examples and confirm its usefulness.…Let's load our files with open, desktop, exercise files,…chapter one, 01_07, and let's start our server…with our environment variables.…With cd, desktop, exercise files, chapter one, 01_07, start,…and let's add our environment variables…so we can connect to the database.…
Let's go to the browser, and refresh.…We had previously autoloaded the URL helper,…so let's open up application, config, autoload,…and go to where we're autoloading the helper.…Let's see what happens…if we remove the autoload of the URL helper.…Let's erase it, and let's refresh.…CodeIgniter will attempt to call methods that,…in that context, do not exist.…So the base URL and set URL functions…would not be available until we autoload the helper.…
So let's leave it like it was before,…
- Loading views and data from containers
- Routing with controllers
- Creating models
- Configuring the data
- Working with data, forms, sessions, and headers
- Logging and error logging
- Extending CodeIgniter to consume dependencies
Skill Level Beginner
PHP: Managing Persistent Sessionswith David Powers2h 41m Intermediate
PHP: Clean URLs on Apache Serverwith David Powers1h 36m Intermediate
1. Get Started with CodeIgniter
2. Work with Data, Logs, Forms, and Headers
3. Take CodeIgniter Further
CodeIgniter and Composer3m 13s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.