Where To Start Editing

Where To Start Editing

Add a new page

The minimal workflow is controller + route + view.

1. Create a controller method

<?php

namespace Keel\App\Controllers;

use Keel\Core\Controller;
use Keel\Core\Request;

class ExampleController extends Controller
{
    public function index(Request $request): void
    {
        $this->view('example.index', ['title' => 'Example']);
    }
}

2. Register the route in routes/web.php

use Keel\App\Controllers\ExampleController;

$router->get('/example', [ExampleController::class, 'index']);

3. Create the view

<!-- views/example/index.php -->
<!DOCTYPE html>
<html lang="en">
<head>
<?php require __DIR__ . '/../partials/head.php'; ?>
</head>
<body>
    <main class="mx-auto max-w-4xl p-6">
        <h1 class="text-2xl font-semibold">Example</h1>
    </main>
</body>
</html>

Renaming Keel for a new project

  1. Update composer.json package name.
  2. Update package.json package name.
  3. Update .env: APP_NAME, APP_URL, and DB_DATABASE.
  4. Swap brand assets in public_html/images/brand/ and matching resource images.
  5. Review landing-page copy in views/welcome.php.