<?php

namespace App\Controller;

use App\Service\Template;

class AddressBook
{
    public function __construct(private readonly Template $template)
    {
    }

    public function main(): void
    {
        try {
            $this->template->render(templateName: 'index.tpl');
        } catch (\Exception $e) {
            die($e->getMessage());
        }

    }
    public function admin(string $command = '')
    {
        try {
            $this->template->render(templateName: 'admin/index.tpl');
        } catch (\Exception $e) {
            die($e->getMessage());
        }
    }

    public function login()
    {
        try {
            $this->template->render(templateName: 'admin/index.tpl');
        } catch (\Exception $e) {
            die($e->getMessage());
        }
    }

}