Composer: how to autoload php classes outside the “vendor”

The Composer ( is a dependency manager (packages) widely used in language PHP and provides many facilities, since it is responsible for checking, download to engage our project all the “libs” of third parties that we will need.

These “libs”, when downloaded by Composer, are grouped within a directory called “vendor”. In addition, a file called “autoload.php” is also created in this folder, responsible for “loading” all the classes we need to use. Basically, all I have to do is import “autoload.php” into a file of my project and I will have access to all classes of “libs” downloaded by Composer.

Continue lendo

[CodeIgniter 4 video lesson] – Models – RELATED CRUD (Insert) – part 2

Hey guys !!! To finalize the new product registration form (“product” table related to “category” table) started in the last video, in this I deal with the submission of the form inside the “controller” and call the “insert” method of the “ProductModel”.

To streamline the process, instead of taking the submitted data and “setting” them in the “model” variable, I pass the submitted data directly via “POST” as a parameter of the “insert” method (through the “method” “this->request->getPost() “).

Continue lendo

[CodeIgniter 4 video lesson] – Models – CRUD with relationship (Insert) – part 1

Hey guys!!!

Continuing with the series on the CodeIgniter 4 framework, in today’s video I start the construction of the “Products” CRUD (which is a table that receives a list of the “Categories” table, using the foreign key “category_id”).

In this first part, I create the “ProductModel” and the controller “Products”. In addition, I also create the view “products_form” and in it I assemble the form for product registration.

Continue lendo

[CodeIgniter 4 video lesson] – Models – Creating a CRUD (Delete)

Hello people!!!

Continuing with the series on CodeIgniter 4, in this video I show how to delete a record in the database using the “delete” method of the Model.

In building the “action” to delete, I make a brief introduction to the “session” library and how to use, from it, the methods “setFlashData” and “getFlashData”.

The video is available at:

I hope you enjoy the video.