Tag: tutorial

Tutorial PHP Smarty Template Engine 4

In this post I will cover the use of the Smarty Template Engine (version 4.0.0) (https://www.smarty.net/) in an introductory way.

Smarty is a engine to manage templates in projects developed in PHP language. Its objective is to enable the separation of the application logic part (php language) and the presentation part (html / css). Thus, we will have a application logic (with the implementation of business rules, data access, distributed form / cookies) and another presentation layer (to present the application layout).

Continue lendo

Respect / Relational – the simplest ORM framework for php

Basically all the main programming languages currently have ORM frameworks (Object Relational Mapping), which help a lot the development of applications (under the object orientation paradigm – OOP) that persist in relational databases (like MySQL, Postgre, SQL Server, among others).

The function of an ORM framework is to abstract objects from a database (tables, columns, relationships, and so forth), map them, and make them readable within a project being developed in OOP.

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 – Creating a CRUD (Consult / List)

Hail guys !!!

In this class of the CodeIgniter 4 series , I continue the subject related to “ models ” and increase the CRUD that I started to develop in the previous video. I show you how to retrieve all data from a database table using a method of our “model” class. These fetched data are returned to a controller and later passed on to be displayed in a “ view ” (via an HTML table).

So, now the CRUD of our project already has the form for registering new records and has a “view” to display all the records that are registered in the table. To “link” the two pages I used the “url” helper (and also showed how to import a helper into a controller).

Continue lendo