First Commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
$lang["submodule_a"]["module_name"] = "Module a Submodule a";
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
$lang["submodule_a"]["module_name"] = "Módulo a Submódulo a";
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Routes\RouteCollection as RouteCollection;
|
||||
|
||||
RouteCollection::add("WEB", "/module_a/submodule_b/", function(){
|
||||
// Doing house keeping work
|
||||
$a = 1;
|
||||
$b = 2;
|
||||
$c = $a + $b;
|
||||
})->doIgnore();
|
||||
|
||||
RouteCollection::get("/module_a/submodule_b/", function(){
|
||||
echo "Executin the /module_a/submodule_b/ route";
|
||||
});
|
||||
|
||||
RouteCollection::get("/module_a/submodule_b/[d:value]", function($value){
|
||||
echo "Executing the /module_a/submodule_b/ route and receaved the value $value";
|
||||
});
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Routes\RouteCollection as RouteCollection;
|
||||
|
||||
RouteCollection::add("WEB", "/module_b/submodule_a/", function(){
|
||||
// Doing house keeping work
|
||||
$a = 1;
|
||||
$b = 2;
|
||||
$c = $a + $b;
|
||||
})->doIgnore();
|
||||
|
||||
RouteCollection::get("/module_b/submodule_a/", function(){
|
||||
echo "Executin the /module_b/submodule_a/ route";
|
||||
});
|
||||
|
||||
RouteCollection::get("/module_b/submodule_a/[d:value]", function($value){
|
||||
echo "Executing the /module_b/submodule_a/ route and receaved the value $value";
|
||||
});
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
use Routes\RouteCollection as RouteCollection;
|
||||
|
||||
RouteCollection::group("/module_b/Submodule_b", function(){
|
||||
RouteCollection::get ("/", "\App\Module_b\Submodule_b\Submodule_bController@index");
|
||||
RouteCollection::get ("/form", "\App\Module_b\Submodule_b\Submodule_bController@create");
|
||||
RouteCollection::post ("/", "\App\Module_b\Submodule_b\Submodule_bController@store");
|
||||
RouteCollection::get ("/[i:id]", "\App\Module_b\Submodule_b\Submodule_bController@show");
|
||||
RouteCollection::get ("/[i:id]/edit", "\App\Module_b\Submodule_b\Submodule_bController@edit");
|
||||
RouteCollection::put ("/[i:id]/edit", "\App\Module_b\Submodule_b\Submodule_bController@update");
|
||||
RouteCollection::delete("/[i:id]", "\App\Module_b\Submodule_b\Submodule_bController@destroy");
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Module_b\Submodule_b;
|
||||
|
||||
class Submodule_b
|
||||
{
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
include_once 'vendor/autoload.php';
|
||||
|
||||
use \Lang\Lang;
|
||||
|
||||
Lang::buildStrings("app/");
|
||||
|
||||
Lang::getString("module_name", "submodule_a");
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "urfat/lang_sandbox",
|
||||
"type": "project",
|
||||
"repositories": [
|
||||
{
|
||||
"type": "path",
|
||||
"url": "../",
|
||||
"options": {
|
||||
"symlink": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"urfat/lang": "*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "app/"
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+45
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "ce8328cb4f81460d55c98dada7c22944",
|
||||
"packages": [
|
||||
{
|
||||
"name": "inforsistemas/routes",
|
||||
"version": "dev-master",
|
||||
"dist": {
|
||||
"type": "path",
|
||||
"url": "..",
|
||||
"reference": "05a330d65e4745ab7ad2f798ae46600b689e8658"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Routes\\": "src/Routes/"
|
||||
}
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Artur Welp",
|
||||
"email": "ahwelp@universo.univates.br"
|
||||
}
|
||||
],
|
||||
"description": "Different Routes",
|
||||
"transport-options": {
|
||||
"symlink": true,
|
||||
"relative": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "dev",
|
||||
"stability-flags": {},
|
||||
"prefer-stable": true,
|
||||
"prefer-lowest": false,
|
||||
"platform": {},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.9.0"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
include '../bootstrap.php';
|
||||
Reference in New Issue
Block a user