Skip to content

Instantly share code, notes, and snippets.

@lksudha
Last active August 20, 2025 23:09
Show Gist options
  • Select an option

  • Save lksudha/be5b25dcc849504ba35730ba73367188 to your computer and use it in GitHub Desktop.

Select an option

Save lksudha/be5b25dcc849504ba35730ba73367188 to your computer and use it in GitHub Desktop.
context and task prompt for ci migration

✅ CodeIgniter 4 Project — Context + Task Prompt Template

Use this format when working with ChatGPT to refactor or migrate pages to CI4. Submit the CONTEXT once, and use the TASK section for specific actions.


🧱 CONTEXT

This is a CodeIgniter 4.6 application.

  • Views: No layout extensions; use plain Bootstrap structure from driver_payments.php
  • Trigger: View is rendered when selected from a dropdown in Home.php
  • Controller Location: DispatchController inside app/Controllers/Dispatch/Pages
  • View Location: app/Views/Pages/
  • Route Setup:
    • Page route in dispatch group
    • API route in api group

Shared Resources:

  • Use render_select() helper for all filter dropdowns
  • Use DriverModel::getActiveDrivers() / getFinishedDrivers()
  • Use SupplierModel::getActiveContractors()
  • Use getDriverNameById() and getSupplierNameById() to resolve names in the API

UI Expectations:

  • Match the exact structure and filter layout of driver_payments.php
  • All filters (driver, supplier, status, category) should be visible at once
  • Use Bootstrap cards, .table-sm, and .table-responsive

API Expectations:

  • Returns paginated data via DataTables (100 rows per page)
  • Uses POST method
  • Filtered using driver/supplier/category/status
  • Result columns must include AssignedTo display name

🛠 TASK

[Example: Migrate complaints.php]

  • Create a new controller method: complaintsView()
  • Add the view complaints_view.php under Views/Pages
  • Create API controller method to return filtered JSON data for DataTables
  • Add necessary routes to Routes.php (dispatch + api)
  • Use the context above for all code structure and styling

Once context is set, you can just say:

"Use the same context. Here's the next task..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment