One of the downsides of CodeIgniter is its own evolution. While other frameworks work flawlessly with today's dependency manager for PHP (aka Composer), CodeIgniter has to be slightly tweaked. So let's tweak CodeIgniter, load a vendor dependency, and consume such dependency.
- [Voiceover] Composer is the long-missing dependency…tool for PHP.…We can easily manage dependencies on our application…with this awesome tool, however, we have to tweak…CodeIgniter in order for us to be able to use Composer.…Let's load our code with open, desktop, Exercise Files,…Chapter 3, 03.01.start, and let's start our server…with cd Desktop/ExerciseFiles/Ch03/03_01_start…and let's start our server with our environment variables.…
The first thing we need to do is to create a new library…to include our auto-load file.…So let's do that.…Let's open up our code and open up application, libraries,…and create a new library.…It will be named Composer_loader.php.…And let's create a class by adding our PHP tags.…And let's create our class with class Composer_loader,…and add a construct here.…public function __construct…and we're going to include our auto-load files…that Composer will generate.…
We did this by including ./vendor/autoload.php.…So every time this class is instanced, this method…is going to be executed and it's going to load…
- 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: Clean URLs on Apache Serverwith David Powers1h 36m Intermediate
PHP: Managing Persistent Sessionswith David Powers2h 41m 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.