Common functionalities

This commit is contained in:
ahwelp
2023-01-24 20:35:43 +00:00
parent 1012e09995
commit d821c32013
43 changed files with 1278 additions and 0 deletions
+111
View File
@@ -0,0 +1,111 @@
<?php
namespace App\Common\Glossary;
use \App\Core\Template\Output as Output;
use \App\Common\Glossary\Classes\Glossary as Glossary;
class GlossaryController extends \DefaultController{
protected $_class = Glossary::class;
protected $_baseUrl = '/glossary';
/**
* Index
* Show the main Glossary 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;
}
Output::render('index', Array('list' => $list));
}
/**
* Create
*
* Render the main Glossary formulary
*/
function create(){
Output::render('form', ['id' => 0]);
}
/**
* Store
*
* Store the param on the database
* @param Glossary $glossary
*/
function store(Glossary $glossary){
}
/**
* Search
*
* Store the param on the database
* @param Glossary $glossary
*/
function search(){
}
/**
* Show
*
* Render one register
*
* @param Glossary $glossary
*/
function show(Glossary $glossary){
}
/**
* Edit
*
* Render the formular for a database Glossary
*
* @param Glossary $glossary
*/
function edit(Glossary $glossary){
Output::render('form', $glossary);
}
/**
* Update
* Store the changes of the param on the database
*
* @param Glossary $glossary
*/
function update(Glossary $glossary){
}
/**
* Destroy
* If the object has soft delete.
*
* @param Glossary $glossary
*/
function destroy(Glossary $glossary){
}
/**
* Purge
* Remove object even with soft delete.
*
* @param Glossary $glossary
*/
function purge(Glossary $glossary){
}
}