Skip to content
Code Igniter helper for outputting popular JS and CSS library CDN links.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
helpers
tests
LICENSE
README.md
splint.json

README.md

Licence MIT Splint Lates Release Commits

cdn-helper

This library makes available, functions that return HTML link/script tags for popular JS and CSS libraries like

  • Bootstrap
  • W3.CSS
  • JQuery
  • Popper.js
  • FontsAwesome
  • REACT

Installation

To install, download and install Splint from https://splint.cynobit.com/downloads/splint and then run the below from your Code Igniter project root

splint install francis94c/cdn-helper

Loading

From anywhere you can access the CI instance

$this->load->splint("francis94c/cdn-helper", "%cdn");

Functions

w3css();
//  returns '<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css" />'
jquery();
//  returns '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>'
bootstrap();
//  returns '<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity=\"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">'
bootstrap(true); // Return JS as well.
/*
returns '<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
*/
popper();
//  returns <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
fontsawesome();
// returns <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
react();
// returns <script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script> <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
You can’t perform that action at this time.