Smithery Logo
MCPsSkillsDocsPricing
Login
NewFlame, an assistant that learns and improves. Available onTelegramSlack
    valec3

    backend-codeigniter-filters

    valec3/backend-codeigniter-filters
    Coding

    About

    SKILL.md

    Install

    • Telegram
      Telegram
    • Slack
      Slack
    • Claude Code
      Claude Code
    • Codex
      Codex
    • OpenClaw
      OpenClaw
    • Cursor
      Cursor
    • Amp
      Amp
    • GitHub Copilot
      GitHub Copilot
    • Gemini CLI
      Gemini CLI
    • Kilo Code
      Kilo Code
    • Junie
      Junie
    • Replit
      Replit
    • Windsurf
      Windsurf
    • Cline
      Cline
    • Continue
      Continue
    • OpenCode
      OpenCode
    • OpenHands
      OpenHands
    • Roo Code
      Roo Code
    • Augment
      Augment
    • Goose
      Goose
    • Trae
      Trae
    • Zencoder
      Zencoder
    • Antigravity
      Antigravity
    • Download skill
    ├─
    ├─
    └─
    Smithery Logo

    Give agents more agency

    Resources

    DocumentationPrivacy PolicySystem Status

    Company

    PricingAboutBlog

    Connect

    © 2026 Smithery. All rights reserved.

    About

    Middleware/filters, authentication, CORS.

    SKILL.md

    Backend CodeIgniter Filters

    When to use this skill

    • Authentication
    • CORS
    • Rate limiting
    • Request/response modification

    Workflow

    • Create filter class
    • Register in Config/Filters.php
    • Apply to routes
    • Handle before/after
    • Return responses or modify request

    Instructions

    Auth Filter

    <?php
    
    namespace App\Filters;
    
    use CodeIgniter\HTTP\RequestInterface;
    use CodeIgniter\HTTP\ResponseInterface;
    use CodeIgniter\Filters\FilterInterface;
    
    class AuthFilter implements FilterInterface
    {
        public function before(RequestInterface $request, $arguments = null)
        {
            $token = $request->getHeaderLine('Authorization');
            
            if (!$this->validateToken($token)) {
                return Services::response()
                    ->setJSON(['error' => 'Unauthorized'])
                    ->setStatusCode(401);
            }
        }
    
        public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
        {
            // Post-processing
        }
    }
    

    CORS Filter

    <?php
    
    class CorsFilter implements FilterInterface
    {
        public function before(RequestInterface $request, $arguments = null)
        {
            header('Access-Control-Allow-Origin: *');
            header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE');
            header('Access-Control-Allow-Headers: Content-Type, Authorization');
    
            if ($request->getMethod() === 'options') {
                exit;
            }
        }
    }
    

    Resources

    • before() runs before controller
    • after() runs after controller
    • Return response to short-circuit
    Recommended Servers
    DataForB2B
    DataForB2B
    Guard Mail
    Guard Mail
    Supabase
    Supabase
    Repository
    valec3/agents.skills.md
    Files