- Видео 8
- Просмотров 64 510
IgnitedCode
США
Добавлен 27 фев 2020
Welcome to the home of CodeIgniter (and related) tutorials by the Lead Developer of CodeIgniter 4, Lonnie Ezell.
Building a Blog - Episode 1
This VLOG entry is a behind-the-scenes look at building a blog and LMS with CodeIgniter 4. I'm just getting started building the software for a new site and CodeIgniter course platform and want to take everyone along.
Only this first video will be available to the public. The rest will be for my Patreon supports. If you want to follow along, be sure to become a supporter. Once the course platform is live you will get full access to all of the courses as they are made available.
Patreon: www.patreon.com/lonnieezell
Initial Course Roadmap: www.patreon.com/posts/new-courses-soon-74393349
My book: CodeIgniter 4 Foundations: leanpub.com/codeigniter4foundations
Only this first video will be available to the public. The rest will be for my Patreon supports. If you want to follow along, be sure to become a supporter. Once the course platform is live you will get full access to all of the courses as they are made available.
Patreon: www.patreon.com/lonnieezell
Initial Course Roadmap: www.patreon.com/posts/new-courses-soon-74393349
My book: CodeIgniter 4 Foundations: leanpub.com/codeigniter4foundations
Просмотров: 1 058
Видео
CodeIgniter Shield Installation and Overview
Просмотров 14 тыс.2 года назад
This video covers the installation of a new CodeIgniter 4 project with the new, official auth package, CodeIgniter Shield. It then follows up with an overview of some of the features. github.com/codeigniter4/shield You can help support me in development of things like CodeIgniter, Shield, and Bonfire (a drop-in admin area for CodeIgniter projects), but becoming a Patron at: www.patreon.com/lonn...
New in CodeIgniter 4.2 - View Decorators
Просмотров 2,1 тыс.2 года назад
CodeIgniter 4.2 just dropped. This is the first of a handful of short videos showing what is new and how to use it in your favorite PHP framework. View Decorators allow you to modify your generated HTML just prior to it being cached. You could use it to build a site-wide snippets function, or more complex solutions, like view components. See more CodeIgniter tutorials at my blog: learncodeignit...
Creating an Admin Area in CodeIgniter 4.1
Просмотров 9 тыс.3 года назад
We look at how I would setup an admin area in CodeIgniter v4.1, separating the front controllers and back controllers, and even a (failed) glimpse at setting up some route protection via Myth:Auth. See more CodeIgniter tutorials at my new blog: learncodeigniter.net Learn more about CodeIgniter 4 in my book, CodeIgniter 4 Foundations, available at leanpub.com/codeigniter4foundations
3 New Features in CodeIgniter 4.0.4
Просмотров 12 тыс.4 года назад
I go over 3 of the new features in CodeIgniter 4.0.4 in this video: - Fabricator for tests, - new command: cache:clear - call commands within your own code. See more CodeIgniter tutorials at my new blog: learncodeigniter.net Learn more about CodeIgniter 4 in my book, CodeIgniter 4 Foundations, available at leanpub.com/codeigniter4foundations
Services in CodeIgniter 4
Просмотров 10 тыс.4 года назад
All about Services in CodeIgniter 4 - what are they, why use them, when to use them, and even how to override core framework classes. See more CodeIgniter tutorials at my new blog: learncodeigniter.net Learn more about CodeIgniter 4 in my book, CodeIgniter 4 Foundations, available at leanpub.com/codeigniter4foundations
Namespaces and CodeIgniter 4
Просмотров 6 тыс.4 года назад
Namespaces are one of the most common confusions that I see on the forums from both long-time CodeIgniter devs and new devs alike. The good news is that they're pretty simple to understand. This (slightly rambling) video goes over the basics of namespaces and how they apply specifically to CodeIgniter 4. More (less rambling) free articles over at Patreon: - Primer: Namespaces www.patreon.com/po...
Installing CodeIgniter 4 with Composer
Просмотров 11 тыс.4 года назад
This is an overview of how to install CodeIgniter 4 using Composer. Along the way we cover the two CodeIgniter repos you should know about, what the .env file is for and why you should use it, and how to use CodeIgniter's built in server for local development use. Learn more about CodeIgniter 4 in my book, CodeIgniter 4 Foundations, available at leanpub.com/codeigniter4foundations
thank you
I feel sorry, for all this great effort poured into these videos and with so little likes. REALLY great content! I came there after was tasked to migrate PHP 7 to PHP 8 and 10+ years old CI 3 codebase to CI 4. 160 tables. Millions of records. And I never worked with PHP/programming. Systems guy. But Im progressing nicely. Currently writing migrations, seeders, entities, basic models and controllers. Old codebase is a mess. No models. Just 8K SLoC controllers. So,... these videos helps me to understand how to better organize the new codebase. Primarily PHP is used just for API. All the frontend is done in JS as SPA. I believe, some use "Features" naming instead of "Modules", but i like Modules more. What currently is not clear for me is... for example, almost in every controller i need to have current user_id or stakeholder_id. And I dont know where should I implement that. Is it like helper? Also, how to prevent IDOR. How to organize huge models with many many complex methods. Listing these like for inspiration from a newbie perspective.
Thanks so much for the kind words. I'm glad they're helping you out!
I'm looking a way, how to configure "system users". Like set of few users which are used just internally and who do not need any Auth functionality. One of such users could be "seeder". I know, I can just inject them into the table, but... could be nice to somehow configure that.
how do i show the bottom toolbar? i have already set codeigniter 4 in development mode but it doesn't show
As long as your baseUrl is set to the domain you’re using (or correct port if you’re using localhost) and the Toolbar filter is uncommented it should show up.
Honestly, on revisiting, i found that you were taking to yourself.
Shortcut tip, if you select the commented out text and do ctrl / command and ? it will auto un-comment or comment the text.
@IgnitedCode How we create these database tables which you shown, can you please give me MySQL file
No need for a MySQL file - just run "php spark migrate --all" from the command line at the project root and it will be created.
Great tutorial! I just have one question. I have noticed that Shield hits the DB unnecessarily even to check if the user is logged in. For e.g. Auth()->loggedIn() or Auth()->getUser(). Pardon my ignorance, but traditionally after a successful login, the user object is stored and retrieved from the session and not overload the DB with get user queries just to check if the user has logged in. Is there a reason for this or am I missing something. We could have saved one expensive db query.
Sorry for the delay: You can turn `$recordActiveDate` to `false` and you should see that stop. github.com/codeigniter4/shield/blob/develop/src/Config/Auth.php#L168
@@ignitedcode3091 I saw the reply only today. Thanks and sorry. I just checked but it is already "false" in my case. Yet, every page visit, Shield runs the 2 DB queries to authenticate user and to get user details & roles. Why would it authenticate the user from DB in every page request? Not sure if its a problem in my config or I have hit a bug. Has anyone else faced this?
May i know why did u put the project name folder inside the app base url(shield-play.test) in .env?
It is good but left me thirsty for more details on the use cases and examples.
Hi, i get an error, when trying to migrate: I dont get the db tables, created. Security Setup: Everything is fine. Run `spark migrate --all` now? [y, n]: y { "title": "Error", "type": "Error", "code": 500, "message": "Undefined constant \"CodeIgniter\\Database\\MySQLi\\MYSQLI_STORE_RESULT\"", "file": "C:\\project-root\\vendor\\codeigniter4\\framework\\system\\Database\\Database.php", "line": 137, "trace": [
Is ORM is added on C4 feature?
Nice, but I would like to have view specific decorators. It is overkill to have the decorator always in the pipeline. I would like to specify which view(s) should be decorated by which decorator(s). So if I have 5 views and only 3 of them contain html which needs to be decorated, I don't want the html of ALL views ALWAYS being decorated. Or did I miss something? I think I can work around this by not preconfiguring the decorators, but just by setting the decorators array run time, based on the view to be displayed. Or is it supposed to work that way?
Thank you, Lonnie. Is there an option to prevent concurrent logins?
Not currently, sorry.
Whoa man!! It is awesome! When is the site coming?
Thanks, and soon! It's pretty much done. Just wrapped up dark mode styles and am fighting some responsive issues. Workload is heavy lately so it is going slower than anticipated, but its close.
@IgnitedCode Can you please make a video on Complete Authentication and Authorization using dynamic Group and User permission.
This is coming in a Mastering Shield course I'm working on for the new site. New episodes getting dropped regularly over at Patreon until the course is finished.
thanks for the tutorial 👍
I have an issue with shield, last_active function is not working at all users active in app but last_active fields is always null... is there anything I can do for this?
Thank you, Lonnie. You're amazing. You've done so much and you're so helpful. I love CI4, love Shield. Really, this is where I want to be. Thanks again, Lonnie.
Wow, thank you!
Thank you for this. Could you explain in some way how to send xml message through CURLRequest.
Hello, Lonnie, i want to ask you about custom UserModel feature. when i run "php spark shield:model" the terminal doesn't recognize it. how to make my own UserModel with my own table?
As long as Shield is installed properly, that command should be available. You can make a new model that extends Shield's UserModel and still get all of the features. You'll need to set the UserProvider to the new class in the Auth config file, I believe.
@@lonnieezellThank you so much Lonnie, i will try it again
elon musk voice
We love your CI4 video tutorials. please make more videos on CodeIgniter and htmx.
Hey, Lonnie, thank you for the video, always learning something new from you.
Awesome 😎 seeing two of Top G's of CodeIgniter in the comments
It is possible to have source code? I have enough to learn. Did you have a course?
The source code for that is not public. No courses, yet. I'm building the site for the currently. I do have a CI4 book, though: leanpub.com/codeigniter4foundations, or lots of videos and articles over at Patreon: www.patreon.com/lonnieezell
@@ignitedcode3091 I already have this book. Thanks 🙏🏾.
I love it from 🇨🇲 thank you we learn enough
You are the only who teaches CI4 very well, why don't you make more tutorials? By the way, thank you !
That's so kind of you! Thanks so much.
Great stuff. 👍
Thank you!
How are you able to have login page? When I installed Shield and ran the migration, I didn't have the login route.
Thank you for this tutorial. Could you do a tutorial on "CI Events"?
Can DB sessions (CI_SESSION) be used with Shield?
Yes, it uses CI's built-in session management, so it will work just fine that way.
@@ignitedcode3091 OK, I asked because I tried using the DB session driver but I receive error "Unable to create file ci_session\..." and the CI_SESSION table is empty when I log in. I will check the forums. Thanks for the video.
great video, can you do, how user permission done? thanks
to be honest i don't understand well at the documentation because there's only few tutorial and poor explanation (because gap knowledge?) i'll not use shield probably i use it in the future maybe, but hi thanks for your tutorial it's really help me so much 😁
Thanks for the tutorial. Doesn't it has an api authentication with Bearer tokens?
It comes with the Access Token handler which can be used for API authentication. github.com/codeigniter4/shield/blob/develop/docs/authentication.md#access-token-authenticator
@@ignitedcode3091 yeah, I already saw it, but I was thinking about a jwt for a front-end app. This is more server side oriented
I hope to see more tutorials about shield, probably with a full functioning application
I hope to do some more. If you want to view a full application you can check out Bonfire - github.com/lonnieezell/Bonfire2
Shield is such good work... Thank You!
so good...! Thank you!
make more videos on codenitor 4.2.1 sir
wow incredible, question does shield will be JWT auth? like for APIRest apps?
It doesn't currently support JWT out of the box, though I know one of the core contributors has started on a solution. Will take more work to get it where we want it but it will likely show up at some point. You can use the Access Tokens for API's, though it's a slightly different workflow.
@@ignitedcode3091 cool thanks a lot man very cool work
I was waiting for shield tutorial so badly thanks 🙏🏾
well given
Thanks Lonnie <3
Thak You!
Thanks a lot, great 🔥🔥
Thanks to Lonnie for the cool review - this is a very interesting functionality for me
what are the difference between services and libraries?
Libraries in CI are just classes. Services provide a way to access that class that allows you to do any initial setup, and also act as a factory, in that they'll only give a single, shared instance of the class no matter how often it's called, unless you tell it otherwise.
@@ignitedcode3091 thank you. If i understand you right, then i use a service only for calling the class (library) and in a library itself is all the logic? Is this the preferred way or can the libraries called also directly?
Thank you. Voice only in left channel
Thanks for letting me know about that!
I noticed it too. Thought it was a problem with my earphones.
Thanks kilishan. ❤️❤️
Great Video (View Decorators) CI 4.2
simple but effective. can we have other video. tips and tricks.
Any particular topics you'd like to see them on?
@@lonnieezell Please do one on modules