You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
187 lines
3.3 KiB
187 lines
3.3 KiB
11 months ago
|
<@php
|
||
|
|
||
|
namespace {namespace};
|
||
|
|
||
|
use {useStatement};
|
||
|
use CodeIgniter\HTTP\ResponseInterface;
|
||
|
|
||
|
class {class} extends {extends}
|
||
|
{
|
||
|
<?php if ($type === 'controller'): ?>
|
||
|
/**
|
||
|
* Return an array of resource objects, themselves in array format.
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function index()
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Return the properties of a resource object.
|
||
|
*
|
||
|
* @param int|string|null $id
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function show($id = null)
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Return a new resource object, with default properties.
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function new()
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Create a new resource object, from "posted" parameters.
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function create()
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Return the editable properties of a resource object.
|
||
|
*
|
||
|
* @param int|string|null $id
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function edit($id = null)
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Add or update a model resource, from "posted" properties.
|
||
|
*
|
||
|
* @param int|string|null $id
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function update($id = null)
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Delete the designated resource object from the model.
|
||
|
*
|
||
|
* @param int|string|null $id
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function delete($id = null)
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
<?php elseif ($type === 'presenter'): ?>
|
||
|
/**
|
||
|
* Present a view of resource objects.
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function index()
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Present a view to present a specific resource object.
|
||
|
*
|
||
|
* @param int|string|null $id
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function show($id = null)
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Present a view to present a new single resource object.
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function new()
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Process the creation/insertion of a new resource object.
|
||
|
* This should be a POST.
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function create()
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Present a view to edit the properties of a specific resource object.
|
||
|
*
|
||
|
* @param int|string|null $id
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function edit($id = null)
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Process the updating, full or partial, of a specific resource object.
|
||
|
* This should be a POST.
|
||
|
*
|
||
|
* @param int|string|null $id
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function update($id = null)
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Present a view to confirm the deletion of a specific resource object.
|
||
|
*
|
||
|
* @param int|string|null $id
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function remove($id = null)
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Process the deletion of a specific resource object.
|
||
|
*
|
||
|
* @param int|string|null $id
|
||
|
*
|
||
|
* @return ResponseInterface
|
||
|
*/
|
||
|
public function delete($id = null)
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
<?php else: ?>
|
||
|
public function index()
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
<?php endif ?>
|
||
|
}
|