Cocktail Version 0.0.6 alpha

Codeigniter + HTML5Boilerplate + Bootstrap

Get the fuel from codeigniter

Get the fuel with Codeigniter MVC framework.

Shake with HTML5Boilerplate best practices

Shake with HTML5Boilerplate best practices.

Serve with Bootstrap

Serve gracefully with Bootstrap and more.

Download Cocktail View on github


Cocktail is a fast front-end builder. It takes the basic code by Codeigniter-Boilerplate but upgrades Codeigniter to version 3, HTML5Boileplate to v. 5. Then it adds Bootstrap (v.3) and bundles several scripts to improve your job.

New in 0.0.6 version, 2017!

CodeIgniter upgrade to 3.1.4

jQuery upgrade to 2.2.4

Libraries: BP_Opendataclient.php

Controllers: Opendataclient.php

Json endpoint: Json.php

Helpers: breadcrumbs_heplper.php (source:

Upgrades: new build for datatables js

Some corrections in templates and views

Cocktail is NOT a end user product, at this stage is more or less a bucket of prototypes and scripts built on top of three solid frameworks.

The most relevant bundled scripts are:

Moreover there are some 'ad hoc' templates, helpers and functions for page rendering:

  • Automatic Toc
  • Automatic Tabs
  • Nifty Footnotes
  • Templates for horizontal and vertical layout
  • Five footer templates
  • A Portfolio template
  • An Open Data Client with a json endpoint
  • Some nice helpers


  • Codeigniter 3.1.4
  • Bootstrap 3.3.6
  • HTML5Boilerplate 5.0.3
  • jQuery 2.2.4


CI Configurations

Codeigniter configuration for Boilerplate starts with:

  • Autoload: url and breadcrumbs helper
  • Autoload: 'BP_Portfolio', 'BP_Opendata', 'SimplePie(Rss feed)' and 'Minifier' libraries
  • Routes: default_controller = "homepage"
  • Index.php: subclass_prefix = "BP_"
  • Base url: http://localhost/cocktail

Cocktail Configurations

Set up main configs for your application in: application/core/BP_controller.php

//Start here your config    
//Status: Set 0 for development or 1 for production
//the production environment combines and 
//minify the css and js		    
protected $status=0; //0=devel, 1=production
//Set your default template 
//cocktail bundles two standard templates: main and vmain
protected $template = "main";

//Set true if you want a navbar
protected $hasNav = true;
//Set the default navbar template
//cocktail bundles two standard templates: nav and vnav
protected $nav = "nav";

//Set if you want to see or not breadcrumbs 
protected $hasBreadcrumbs=true;

//If you use the vertical navigator layout
//set here the offcanvas : bool(true|false)
protected $offcanvas=false;
protected $offcanvas_pos='left';
//Page Meta
public $title = false;
public $description = false; 
//Page contents
public $javascript = array('vendor/jquery-2.2.4.min.js','vendor/bootstrap.min.js');
public $appjs = array('plugins.js','main.js');
public $css = array('bootstrap.min.css', 'bootstrap-theme.css','font-awesome.min.css');
public $appcss=array('main.css');
public $GFont = array('Oxygen','Cookie');
public $content = false;
//Set true if you want a footer   
protected $hasFooter = true;

//Set true to activate cookieLaw plugin
// and cookie.js file
protected $cookieLaw = true; 
protected $cookies = "cookies";

Controller Configurations

Set specific config of any page in its controller, example: application/controllers/Homepage.php

// Define Meta
// Define section title
$this->title = "Example!";
// Define section description
$this->description = "A Codeigniter-Boilerplate example";

// Define custom CSS
$this->css[] = "bp_homepage.css";
$this->css[] = "bp_example.css";

// Define custom JS
$this->javascript[] = 'vendor/jquery.dataTables.min.js';
$this->javascript[] = 'vendor/dataTables.bootstrap.min.js';

// Import Google Font Lobster and Puritan
$this->GFont = array("Lobster","Puritan");

Be careful, this is important for: css, js and GoogleFont management.

  • This APPENDS data to BP_Controller array:
    $this->javascript[] = 'vendor/jquery.dataTables.min.js';
  • This OVERWRITES the data ofBP_Controller array:
    $this->GFont = array("Lobster","Puritan");