2017 © Pedro Peláez
 

library caramel

Caramel is Codeigniter package

image

namemsile/caramel

Caramel is Codeigniter package

  • Saturday, March 5, 2016
  • by sunthera
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Caramel

caramel, (*1)

Caramel is codeigniter package. Delight for your web application., (*2)

Caramel mixed with Illuminate Database library, Twig template engine and Sentry authorization and authentication package, (*3)

Install

Install Codeigniter framework firstly. You can just simply download .zip package from Codeigniter website or via composer:, (*4)

composer create-project bcit-ci/CodeIgniter

Once Codeigniter installed,, (*5)

in application/config/config.php set Composer autoloader path:, (*6)

$config['composer_autoload'] = FCPATH . 'vendor/autoload.php';

In composer.json file and add psr-4 autoload for models:, (*7)

"autoload": { "psr-4": { "App\\Models\\": "application/models/" } },, (*8)

then run composer require command:, (*9)

composer require namesmile/caramel

Usage

Controller

Caramel shipped with abstract Caramel_Controller. Caramel controller can use templates and auth library., (*10)

To enable templating for controller you need setup protected $templated to true. For auth acccess to controller, just change protected $guarded to true also., (*11)

use Smartcat\Caramel\Controllers\Caramel_Controller;

    /**
     * Use template
     * @var bool
     */
    protected $templated = true;

    /**
     * Use garde
     * @var bool
     */
    protected $guarded = true;

    /**
     * Controller constructor
     */
    public function __construct()
    {
        parent::__construct();

        /**
         * Check auth
         */
        if (! $this->garde->check()) {
            $this->template->set_flash('Auth consroller');
            redirect('/');
        }
    }

    /**
     * Index controller method
     *
     * @return CI_Output
     */
    public function index()
    {
        return $this->template->render('app');
    }

You can also use only garde or template independently., (*12)

The Versions

05/03 2016

dev-master

9999999-dev

Caramel is Codeigniter package

  Sources   Download

MIT

The Requires

 

21/08 2015
20/08 2015
28/07 2015
20/07 2015