Templates - Controller

Standard Functionality

By default the controller can render a bootstrap 4 template with 4 main areas

+---------------------------------------+
| Navbar                                |
+---------------------------+-----------+
| Primary                   | Secondary |
| 9 Columns                 | 3 Columns |
+---------------------------+-----------+
| Footer                                |
+---------------------------------------+

Example

The controller encapsulates a mini application. For Example, a table that requires maintenance, perhaps a stock item

<?php
/*  http://creativecommons.org/licenses/by/4.0/ */

class _template extends Controller {
    protected function access_control() {
        if ( true) {
            return ( true);

        }

        return ( false);

    }

    protected function posthandler() {
        $action = $this->getPost('action');

        if ( 'gibblegok' == $action) { \Json::ack( $action); }
        else { \Json::nak( $action); }

    }

    protected function _index() {
        $this->render([
            'title' => $this->title = sprintf( '%s : Index', $this->label),
            'primary' => 'blank',
            'secondary' => 'blank']);
    }

    function index() {
        $this->isPost() ?
            $this->postHandler() :
            $this->_index();

    }

}