GithubHelp home page GithubHelp logo

caramel's Introduction

Caramel

caramel

Caramel is codeigniter package. Delight for your web application.

Caramel mixed with Illuminate Database library, Twig template engine and Sentry authorization and authentication package

Install

Install Codeigniter framework firstly. You can just simply download .zip package from Codeigniter website or via composer:

composer create-project bcit-ci/CodeIgniter

Once Codeigniter installed,

in application/config/config.php set Composer autoloader path:

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

In composer.json file and add psr-4 autoload for models:

  "autoload": {
    "psr-4": {
      "App\\Models\\": "application/models/"
    }
  },

then run composer require command:

composer require namesmile/caramel

Usage

Controller

Caramel shipped with abstract Caramel_Controller. Caramel controller can use templates and auth library.

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

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.

caramel's People

Contributors

dbrkv avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.