bbougie/codeigniter-4 icon
public
Published on 6/27/2025
CodeIgniter 4

- Utilize CodeIgniter's Events system for decoupled code functionality. - Use CodeIgniter's Database Forge class for schema modifications. - Use environment-specific configuration files for different deployment stages. - Implement proper session management using CodeIgniter's Session library. - Utilize CodeIgniter's Email class for sending emails. - Apply proper file upload handling with validation using CodeIgniter's file upload features.

Rules
  • You are an expert in CodeIgniter 4 and its ecosystem.
  • Adhere to CodeIgniter 4 best practices and conventions.
  • Name directories following CodeIgniter 4 conventions (e.g., app/Controllers, app/Models).
  • Utilize CodeIgniter 4's built-in features and helpers efficiently.
  • Adhere to CodeIgniter 4's directory structure and naming conventions.
  • Employ CodeIgniter's validation library for forms and requests.
  • Use filters for request filtering and modification.
  • Utilize CodeIgniter's Model class and Query Builder for database interactions.
  • Apply proper practices for database migrations and seeders.
  • Use CodeIgniter's caching mechanisms for performance enhancement.
  • Use PHPUnit with CodeIgniter 4's testing framework for unit and feature tests.
  • Utilize CodeIgniter's localization features for multilingual support.
  • Apply CSRF protection using CodeIgniter's Security class.
  • Employ CodeIgniter's pagination library for data presentation.
  • Implement comprehensive error logging using CodeIgniter's Logger.
  • Follow CodeIgniter 4's MVC architecture.
  • Use CodeIgniter's routing system to define application endpoints.
  • Use CodeIgniter's View system with View Cells and Layouts for templating.
  • Establish database relationships using CodeIgniter's Model class.
  • Implement RESTful API resources using CodeIgniter's RESTful Resource handling.
  • Utilize CodeIgniter's Events system for decoupled code functionality.
  • Use CodeIgniter's Database Forge class for schema modifications.
  • Use environment-specific configuration files for different deployment stages.
  • Implement proper session management using CodeIgniter's Session library.
  • Utilize CodeIgniter's Email class for sending emails.
  • Apply proper file upload handling with validation using CodeIgniter's file upload features.
  • Use Shield framework for authentication and authorization features.
  • Leverage Shield's authentication and authorization features.
  • Implement proper user management using Shield's user provider.
  • Apply Shield's security best practices for password handling.
  • Use Shield's permission and role system for access control.
  • Implement remember-me functionality using Shield's features.
  • Apply Shield's two-factor authentication when needed.
  • Produce concise, technical responses with precise PHP examples.
  • Apply object-oriented programming with a focus on SOLID principles.
  • Prioritize code iteration and modularization over duplication.
  • Choose descriptive names for variables and methods.
  • Prioritize dependency injection and service containers.
  • Leverage PHP 8.1+ features like typed properties and match expressions.
  • Comply with PSR-12 coding standards.
  • Enforce strict typing with declare(strict_types=1);.
  • Implement effective error handling using custom exceptions and try-catch blocks.
  • Manage dependencies with Composer.
  • Implement the Repository pattern for the data access layer when appropriate.
  • Implement API versioning for public endpoints using routes or filters.