Skip to main content
AdminVora

CodeIgniter 4 admin template

AdminVora is plain HTML, CSS and vanilla JavaScript, which is exactly what a CodeIgniter view already is. There is nothing to compile and no front-end framework to adopt: you copy the files, write one layout, and every screen in the download becomes a view.

Why it fits CodeIgniter

  • No Node, no npm, no bundler. The download includes the compiled CSS and JavaScript, so a CodeIgniter project stays a PHP project.
  • Components are attributes. A data grid, a select or a date field is markup with a data-av-* attribute, so your controllers render it like any other HTML.
  • Built for a strict Content Security Policy. Nothing is fetched from a CDN, and the one inline script takes CodeIgniter's own nonce.
  • Proven in production. The admin behind creativeigniter.com is a CodeIgniter 4 application built on AdminVora.

1. Copy the assets

Copy the download's dist/ folder to public/assets/adminvora/ as it is. Keep css/, js/, vendor/ and img/ side by side: the runtime loads charts, editors and the other heavy libraries from ../vendor/ only when a page uses them.

2. Write one layout

One part has to stay inline: the boot script in the <head> of every page in the download. It sets the theme before the first paint, so it cannot be deferred or moved to a file. Copy it into a partial once, as below. Under CodeIgniter's CSP support, open that tag as <script <?= csp_script_nonce() ?>> and it carries the nonce.

<!-- app/Views/layouts/admin.php -->
<!doctype html>
<html lang="en" data-bs-theme="light" data-av-preset="aurora">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <?= csrf_meta() ?>
  <title><?= esc($title ?? 'Admin') ?></title>
  <?= $this->include('partials/boot') ?>
  <link rel="stylesheet" href="<?= base_url('assets/adminvora/css/adminvora.min.css') ?>">
</head>
<body class="av-app">
  <a href="#main" class="av-skip-link">Skip to main content</a>
  <div class="av-shell">
    <?= $this->include('partials/sidebar') ?>
    <div class="av-main">
      <?= $this->include('partials/topbar') ?>
      <main class="av-content" id="main" tabindex="-1">
        <div class="container-fluid">
          <?= $this->renderSection('content') ?>
        </div>
      </main>
    </div>
  </div>
  <script src="<?= base_url('assets/adminvora/js/adminvora.js') ?>" defer></script>
</body>
</html>

3. Every screen is a view

Take the markup of any page in the download, keep what sits inside .container-fluid, and put it in a section. The sidebar and topbar partials come from the same pages.

<!-- app/Views/admin/orders.php -->
<?= $this->extend('layouts/admin') ?>

<?= $this->section('content') ?>
  <h1>Orders</h1>
  <!-- the orders table from the download, with your rows -->
<?= $this->endSection() ?>

Deletes, forms and CSRF

Mark a delete button with data-av-confirm and AdminVora asks first: nothing is sent while the dialog is open, "Cancel" sends nothing, and the accept button submits the form as normal, with your CSRF token and the button's own name and value.

<form method="post" action="<?= site_url('admin/orders/' . $order->id . '/delete') ?>">
  <?= csrf_field() ?>
  <button class="av-btn av-btn--outline-danger" type="submit"
          data-av-confirm
          data-av-confirm-title="Delete order #<?= esc($order->id) ?>?"
          data-av-confirm-accept="Delete order">Delete</button>
</form>

CodeIgniter questions

Not yet. The eight kits cover static HTML, Laravel, Django, Express, React, Vue, Next and Nuxt. CodeIgniter needs no kit to work: the layout above is the whole of the wiring, and the static HTML kit has the same sidebar, topbar and pages ready to paste into views.

Yes. Nothing in AdminVora depends on the framework version: CodeIgniter 3 loads the same files with $this->load->view() instead of layouts and sections.

Yes. Every file is served from your own domain, and the single inline boot script takes CodeIgniter's script nonce.

See it, then decide

The live demo is the product itself: the same pages, stylesheet and runtime the download contains. Licences start at $39 on the pricing page, and the documentation covers every component and hook.