Initial commit of LightMVC framework files.
This commit is contained in:
Executable
+14
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
namespace App\Controllers;
|
||||
|
||||
use Core\Controller;
|
||||
|
||||
class ApiController extends Controller
|
||||
{
|
||||
public function ping()
|
||||
{
|
||||
// Simple health-check endpoint
|
||||
$this->response->setHeader('Content-Type', 'application/json');
|
||||
$this->response->setBody(json_encode(['status' => 'ok', 'time' => microtime(true)]));
|
||||
}
|
||||
}
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use Core\Controller;
|
||||
|
||||
class SiteController extends Controller
|
||||
{
|
||||
public function home()
|
||||
{
|
||||
return $this->render('home', [
|
||||
'name' => 'My PHP MVC Framework'
|
||||
]);
|
||||
}
|
||||
|
||||
public function contact()
|
||||
{
|
||||
return $this->render('contact');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user