smithery/valec3

backend-codeigniter-controllers

Controller patterns, request handling, RESTful design.

Installation

$ npx skills add smithery/valec3 --skill backend-codeigniter-controllers

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/valec3 · top by installs.

npx skills add smithery/valec3

Browse all from smithery/valec3

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,445 B
  • docs SUMMARY.md 93 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Backend CodeIgniter Controllers

When to use this skill

  • Creating API endpoints
  • Handling HTTP requests
  • RESTful controllers
  • Resource controllers

Workflow

  • Extend ResourceController for REST
  • Keep controllers thin
  • Validate input
  • Return appropriate responses
  • Handle errors properly

Instructions

REST Controller

<?php

namespace App\Controllers;

use CodeIgniter\RESTful\ResourceController;

class UserController extends ResourceController
{
    protected $modelName = 'App\Models\UserModel';
    protected $format = 'json';

    public function index()
    {
        return $this->respond($this->model->findAll());
    }

    public function show($id = null)
    {
        $user = $this->model->find($id);
        if (!$user) {
            return $this->failNotFound();
        }
        return $this->respond($user);
    }

    public function create()
    {
        $rules = ['email' => 'required|valid_email'];
        if (!$this->validate($rules)) {
            return $this->failValidationErrors($this->validator->getErrors());
        }

        $id = $this->model->insert($this->request->getJSON(true));
        return $this->respondCreated(['id' => $id]);
    }
}

Resources

  • Use ResourceController for REST
  • Validate all input
  • Return proper HTTP status