Skip to content

Latest commit

 

History

History
208 lines (171 loc) · 2.46 KB

CONTROLLERS.md

File metadata and controls

208 lines (171 loc) · 2.46 KB

Alternate Snippets for Controllers

[ProjectRoot]/app/Controllers/**.php

Table of Content

Controllers

COMMANDS RENDERS
ci4:controller
public function index()
{
    // code
}
Presenter
COMMANDS RENDERS
ci4:controller:presenter
public function __construct()
{
    // __construct code
}

public function index()
{
    // index code
}

public function show($id = null)
{
    // show code
}

public function new()
{
    // new code
}

public function create()
{
    // create code
}

public function edit($id = null)
{
    // edit code
}

public function update($id = null)
{
    // update code
}

public function remove($id = null)
{
    // remove code
}

public function delete($id = null)
{
    // delete code
}
Resources
COMMANDS RENDERS
ci4:controller:resources
public function __construct()
{
    // __construct code
}

public function index()
{
    // index code
}

public function show($id = null)
{
    // show code
}

public function new()
{
    // new code
}

public function create()
{
    // create code
}

public function edit($id = null)
{
    // edit code
}

public function update($id = null)
{
    // update code
}

public function delete($id = null)
{
    // delete code
}
Request Class
COMMANDS RENDERS
ci4:controller:request
$this->request->Type('field name');
Type : getVar, getGet, getPost, getMethod, isAjax, isCLI, isSecure