First Commit

This commit is contained in:
2026-08-19 11:22:14 -03:00
commit 8d49b22915
15 changed files with 612 additions and 0 deletions
@@ -0,0 +1,122 @@
<?php
namespace App\Module_b\Submodule_b;
use App\Module_b\Submodule_b\Submodule_b as Submodule_b;
class Submodule_bController {
/**
* Index
* Show the main Users list
*/
function index(){
$list = Array();
for($i = 0; $i <= 10; $i++){
$obj = Array();
$obj['id'] = $i;
$obj['value'] = md5($i);
$obj['description'] = sha1($i);
$list[] = $obj;
}
header('Content-Type: application/json; charset=utf-8');
echo json_encode($list);
}
/**
* Create
*
* Render the main Users formulary
*/
function create(){
Output::setView('form', ['id' => 0]);
Output::render();
}
/**
* Store
*
* Store the param on the database
* @param Users $users
*/
function store(Submodule_b $Submodule_b){
$info = array_merge(["message" => "The following data was receaved by POST on the store function"], $_POST);
header('Content-Type: application/json; charset=utf-8');
echo json_encode($info);
}
/**
* Show
*
* Render one register
*
* @param Users $users
*/
function show(Submodule_b $Submodule_b){
$i = rand(0, 1000);
$info = [
'id' => $i,
"value" => md5($i),
"description" => sha1($i),
];
header('Content-Type: application/json; charset=utf-8');
echo json_encode($info);
}
/**
* Edit
*
* Render the formular for a database Users
*
* @param Users $users
*/
function edit(Submodule_b $Submodule_b){
$info = array_merge(["message" => "The following data was receaved by POST on the edit function"], $_POST);
header('Content-Type: application/json; charset=utf-8');
echo json_encode($info);
}
/**
* Update
* Store the changes of the param on the database
*
* @param Users $users
*/
function update(Submodule_b $Submodule_b){
$info = array_merge(["message" => "The following data was receaved by POST on the update function"], $_POST);
header('Content-Type: application/json; charset=utf-8');
echo json_encode($info);
}
/**
* Destroy
* If the object has soft delete.
*
* @param Users $users
*/
function destroy(Submodule_b $Submodule_b){
$info = array_merge(["message" => "The following data was receaved by POST on the destroy function"], $_POST);
header('Content-Type: application/json; charset=utf-8');
echo json_encode($info);
}
/**
* Purge
* Remove object even with soft delete.
*
* @param Users $users
*/
function purge(Submodule_b $Submodule_b){
$info = array_merge(["message" => "The following data was receaved by POST on the destroy function"], $_POST);
header('Content-Type: application/json; charset=utf-8');
echo json_encode($info);
}
}