<div class="header">
    <h1>Edit category</h1>
</div>

<?php if (session('error')): ?>
<p class="error"><?= esc(session('error')) ?></p>
<?php endif ?>

<form method="post" action="<?= base_url('admin/shop/category/edit/' . $category->id) ?>">
    <input type="hidden" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>">
    <p>
        <label>Name</label><br>
        <input type="text" name="name" value="<?= esc($category->name) ?>" required>
    </p>
    <p>
        <button type="submit" class="btn btn-primary">Save</button>
        <a href="<?= base_url('admin/shop') ?>" class="btn btn-secondary">Cancel</a>
    </p>
</form>
