Dependency Injection in Slim - The ULTIMATE Web-API course with PHP & Slim [Ep. 005]

Channel:
Subscribers:
3,810
Published on ● Video Link: https://www.youtube.com/watch?v=kgSNdmbOp9U



Duration: 27:41
615 views
24


In this episode i will show you how you can easily use a very important programming concept called "dependency injection" in your Slim web API's. You will learn how you can setup your own dependency injection container with PHP-DI and how to register custom dependencies with different methods like autowiring, etc. Then i will show you how to inject those dependencies in your services and controllers. We will also focus on restructuring our app.

🌐 Website:
https://robbelroot.de

📄 Official Documentations:
https://php-di.org/
https://www.slimframework.com/docs/v4

📖 Chapters
00:15 Recap of last episode
02:11 Todays topic - DI
02:31 A general DI explanation
03:14 Another concept - IoC
03:52 Why DI
04:24 Into the Slim app
04:55 Fixing known WinNMP errors
06:26 Installing Slim http implementation
06:51 Basic Slim setup
07:53 Setting up DI with php-di
08:35 Fixing php-di composer error
10:09 Creating dependencies.php file
11:48 Creating an example service
12:55 Adding a dependency definition
14:09 Not nice
16:18 More explanation on DI
18:11 Rely on abstractions not implementations
19:37 Restructuring our app
25:31 Autowiring dependencies

HASHTAGS: #slim #php #dependencyinjection #framework #webprogramming #programming #tutorial




Other Videos By RobbelRoot


2022-05-12Mehr GST ohne jegliche Upgrades verdienen? So geht's! - StepN (deutsch) (mit 2 Energie)
2022-05-11Ist mein 1000€ StepN Investment futsch!? +Activation Code - StepN (deutsch) Reise Update 1
2022-05-0735€ am Tag fĂŒr's Laufen oder Totalverlust? Meine Reise mit StepN (deutsch) - Move2Earn
2022-04-01🎓 Programmieren lernen mit meinem individuellen Unterricht
2022-04-01Wenn die Transportsoftware mal wieder spinnt.. [PARODIE]
2022-02-25When hopes and prayers don’t help #shorts #ukraine
2022-02-18Erstelle Dein eigenes VB NET Plugin-System – das ULTIMATIVE Tutorial
2022-02-18INI-Dateien lesen und schreiben in VB.NET – Einstellungen verwalten (Remake)
2022-02-07If your dog 🐕 bullies you
 #
2022-01-22Hacking a Webshop – HOW to and how NOT to fall for this common trap!
2022-01-15Dependency Injection in Slim - The ULTIMATE Web-API course with PHP & Slim [Ep. 005]
2022-01-14The middleware concept (eg. authentication) - The ULTIMATE Web-API course with PHP & Slim [Ep. 004]
2022-01-12Hacking a .NET Application or how to avoid getting hacked | counts for like all client code!
2022-01-11Convert DaVinci Resolve markers to YouTube chapters (EDL files)
2022-01-11Die aktuelle Börsensituation mit Mr. DĂŒm-dĂŒdĂŒm-dĂŒdĂŒm-dĂŒdĂŒm #Shorts
2022-01-09New RobbelRoot Channel Trailer
2022-01-06Getting deeper into Slim Routes - The ULTIMATE Web-API course with PHP & Slim [Ep. 003]
2022-01-05Creating our first little Slim-App example - The ULTIMATE Web-API course with PHP & Slim [Ep. 002]
2022-01-05Setting up our developer environment - The ULTIMATE Web-API course with PHP & Slim [Ep. 001]
2021-11-03Doggo goes crazy when im only touching my jacket
2021-10-26Doggo thinks i can‘t see him hiding behind the bush, bruh..



Tags:
programming
web
application
api
json
slim
slim4
interface
php
language
tutorial
course
free
hd
webapp
software
development
deploy
full
study
guide
explanation
helloworld
microframework
server
webserver
cgi
ini
http
https
xampp
winnmp
mariadb
mysql
doctrine
example
first
route
routes
get
dependency
injection
di
phpdi
concept
ioc
inversion of control