|
|
|
<@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 ?>
|
|
|
|
}
|