Web Development · WDC-39

Basic CodeIgniter Framework

Basic CodeIgniter Framework is a beginner course in building web applications with CodeIgniter 4.7, from installation, routing and MVC to databases, forms, file uploads, email, membership with Shield and protection against common vulnerabilities. It suits people with some PHP experience, students, teachers and IT staff who look after CodeIgniter websites.

Updated
From 4,950 THB / person 5,500 −10% excl. VAT 7% · group rates available
PDFDownload the course outline
  • Duration18 hours · 3 days
  • FormatOnsite / live online
  • Next roundOn request
  • CertificateIncluded

Course overview

CodeIgniter is a lightweight PHP framework with a simple structure that is easy to install and quick to learn, which makes it a good starting point for anyone new to frameworks. Splitting work along MVC lines keeps code tidy, lets several people work together and allows later changes without affecting other parts. The current release is CodeIgniter 4.7, which requires PHP 8.2 or later and supports PHP 8.5.

This course builds a solid CodeIgniter 4 foundation step by step, from installation, configuration, routing, controllers and views to the database with migrations, the query builder and models. Learners build create, update and delete features, validate forms, upload files, send email, manage sessions and cookies, add membership with Shield and defend against common vulnerabilities, then finish with a small online shop workshop and deployment. (3 days, 6 hours per day, 18 hours in total, Beginner level.)

What you’ll gain

  • Understand CodeIgniter 4 and the MVC approach to development
  • Install and configure CodeIgniter 4.7 correctly with Composer and the .env file
  • Build pages with routing, controllers, views and helpers
  • Work with the database through migrations, the query builder, models and entities
  • Validate forms, upload files, send email and manage sessions and cookies
  • Add membership with Shield and defend against XSS, SQL injection and CSRF
  • Deploy a CodeIgniter website to production safely

Who this course is for

  • People with some PHP experience who want to start using a PHP framework
  • Students, teachers and lecturers working on or teaching PHP web projects
  • IT staff and system administrators who look after CodeIgniter websites
  • People maintaining CodeIgniter 3 systems who want to start with CodeIgniter 4

Prerequisites

  • Able to write basic PHP, including variables, conditions, loops and functions
  • Basic HTML and CSS, and an understanding of website design
  • A general understanding of databases, and confident use of Windows or macOS
  • A laptop that can run PHP 8.2 or later, Composer and VS Code, with permission to install software

Curriculum

Course Details

This course is the 2026 edition of Basic CodeIgniter Framework. It runs for 3 days, 6 hours per day (18 hours in total, 09:00-16:00), as lectures with labs and a workshop. Beginner level. This edition uses CodeIgniter 4.7 on PHP 8.5, replaces the old autoload and base URL settings with the .env file and Composer, and adds migrations, entities, filters, membership with Shield and deployment. It keeps the everyday basics: databases, forms, file uploads, email, sessions, cookies, caching, multiple languages and security. The course focuses on fundamentals for people new to frameworks, unlike PHP OOP and CodeIgniter Framework, which builds an OOP foundation and focuses on REST APIs and SQL Server. Learners take home a lab guide, source code for every lab and their workshop project.

Day 1 Getting Started with CodeIgniter 4 and MVC

Section 1: An Overview of CodeIgniter 4 and MVC

  • What a PHP framework is, and what CodeIgniter does well
  • How CodeIgniter 4 differs from CodeIgniter 3
  • Models, views and controllers
  • System requirements: PHP 8.2 or later with intl and mbstring

Section 2: Lab: Installing CodeIgniter 4.7

  • Install PHP 8.5, Composer and VS Code
  • Create a project with composer create-project codeigniter4/appstarter
  • Run the site with php spark serve
  • The app, public, writable and vendor folders

Section 3: Configuration and Routing

  • Set baseURL, the environment and the database in the .env file
  • Defined routes, route groups and URL parameters
  • Improved auto routing, and why to enable it only where needed
  • Lab: routes for a sample website

Section 4: Controllers, Views and Helpers

  • Controllers, requests and responses
  • Views, view layouts and view cells
  • Common helpers such as url, form and text, and common functions
  • Lab: several pages sharing one layout

Section 5: Lab: Page Design with Bootstrap 5

  • Organise CSS, JavaScript and images in the public folder
  • Use Bootstrap 5 for layout and a responsive menu
  • Redirects and flashdata for notifications
  • Lab: a site template used throughout the course
Day 2 Databases, Forms and Everyday Web Tasks

Section 6: Lab: Databases and Migrations

  • Connect to MySQL or MariaDB
  • Create tables with migrations and sample data with seeders
  • The query builder for select, insert, update and delete
  • Query binding to prevent SQL injection

Section 7: Models and Entities

  • Models with allowedFields, timestamps and soft deletes
  • Search and paginate with paginate() and the pager
  • Entities for mapping data to objects
  • Lab: create, update, delete and list products

Section 8: Form Validation

  • Forms with the form helper, and old() to keep previous input
  • Validation rules and error messages in Thai
  • CSRF protection through a filter
  • Lab: a fully validated sign-up form

Section 9: Lab: File Uploads

  • Receive files with getFile() and check them with isValid()
  • The uploaded, is_image, mime_in and max_size rules
  • Store files with store() or move() and rename them
  • Lab: attach product images and show previews

Section 10: Sessions, Cookies and Email

  • Sessions, flashdata and tempdata
  • Cookies and secure cookie settings
  • Send email with the Email class over SMTP and test it with Mailpit
  • Lab: a sign-up confirmation email
Day 3 Membership, Security and Workshop

Section 11: Libraries, Filters and Error Handling

  • Use built-in libraries and write your own
  • Filters that run before and after a controller
  • Error pages, exceptions and logs per environment
  • Lab: a filter that guards the admin pages

Section 12: Lab: Membership with Shield

  • Install Shield with Composer and php spark shield:setup
  • Sign-up, login and logout
  • Groups and permissions to separate access rights
  • Lab: protect the back office with Shield

Section 13: Web Application Security

  • Prevent XSS with esc() and a Content Security Policy
  • Prevent SQL injection and CSRF
  • Store passwords with password_hash and hide errors in production
  • A security checklist before going live

Section 14: Caching, Languages and Performance

  • Page caching and data caching
  • Multiple languages with language files and lang()
  • The debug toolbar, benchmarking and profiling
  • Lab: a bilingual site with a cached home page

Section 15: Workshop: A Small Online Shop, Deployed

  • Combine products, membership, uploads and email into one site
  • Return JSON for simple JavaScript calls
  • Deploy with public as the document root and the production environment
  • Use an AI assistant to review code with care, and next steps

Schedule & training options

For individuals — public rounds

No public rounds are open right now. Join the waiting list and we will contact you first when the next round opens, or ask us on LINE. Or call 02-570-8449 or 088-807-9770

For organisations — in-house / private

  • Tailor the content to your team’s tools and projects
  • Your dates, at your office or live online
  • Quotation with tax ID for procurement
Corporate training quote

Instructors

Frequently asked questions

How does MVC divide the work in CodeIgniter?

The controller receives the request for a URL defined in the routes, calls the model to read or save data, then passes the data to the view, an HTML and PHP file that renders the page. This separation lets you change the design without touching the logic and reuse models across pages. Shared helper code lives in helpers or libraries, and checks before a page is reached are done with filters.

How do you prevent SQL injection and XSS in CodeIgniter 4?

For SQL injection, use the query builder, models or query binding, which keep values separate from the SQL instead of joining strings yourself. For XSS, escape data before output with esc() every time and consider enabling a Content Security Policy. Turn on CSRF protection through a filter to block forged form posts from other sites, store passwords with password_hash() and hide error details in production.

How do you build a file upload with CodeIgniter 4?

Create a form with enctype set to multipart/form-data and a file input. In the controller, check the file with validation rules such as uploaded, is_image, mime_in and max_size, get it with $this->request->getFile(), confirm it with isValid(), then store it with store() or move() and save the file name to the database. Always restrict file type and size, and keep CodeIgniter up to date to receive security fixes.

Who is the Basic CodeIgniter Framework course for, and what should I know beforehand?

It suits people with some PHP experience who want to start using a framework, students, teachers, lecturers, IT staff and system administrators, and people maintaining CodeIgniter 3 systems. You should be able to write basic PHP, HTML and CSS, understand website design and general database use, and be comfortable with Windows or macOS.

What will I be able to do after the Basic CodeIgniter Framework course?

You will be able to install and configure CodeIgniter 4.7, structure an MVC application, create tables with migrations, build create, update and delete features with models, validate forms, handle file uploads and email, manage sessions and cookies, add membership with Shield, defend against XSS, SQL injection and CSRF, and put the site into production. Participants receive a Certificate of Completion with its own number that can be verified online.

Can the Basic CodeIgniter Framework course be run in-house for our team?

Yes. It can be run in-house for your team, with examples adapted to your work, such as practising on a PHP system your team maintains or planning a move from CodeIgniter 3 to CodeIgniter 4. You can request a quotation from this page, or contact us on LINE @itgenius or by phone on 02-570-8449.