Modified default controller from index.php to app.php
This commit is contained in:
parent
841b16266a
commit
c9365707b8
3 changed files with 51 additions and 5 deletions
31
modules/welcome/controllers/app.php
Normal file
31
modules/welcome/controllers/app.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
function controller($switch='') {
|
||||
|
||||
switch($switch) {
|
||||
|
||||
default:
|
||||
|
||||
return 'Welcome to the real world!';
|
||||
|
||||
break;
|
||||
|
||||
case 'good':
|
||||
|
||||
return 'All things are good!';
|
||||
|
||||
break;
|
||||
|
||||
case 'json':
|
||||
|
||||
$data=['data' => 'Cool'];
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
return json_encode($data);
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue