1. Go to this page and download the library: Download uncaose/straight-ci-layout library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$config['modules'] = ['layout'];
$config['asset_controller'] = 'asset';
$config['asset_hashkey'] = 'md5';
$config['asset_nocache_uri'] = TRUE; // TRUE : /asset/css/style.css?_=abc...1234, FALSE : /asset/cas/style.css
$config['asset_combine'] = TRUE; // TRUE|FALSE css, js combine, TRUE: use cache if possible or query
$config['asset_minify_js'] = TRUE; //
Class Welcome extends MY_Controller
{
public function index() {
$this->load
->cache(5)
->css('https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css')
->js([
['src'=>'https://code.jquery.com/jquery-3.2.1.slim.min.js', 'integrity'=>'sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN','crossorigin'=>'anonymous'],
'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js',
])->js([
'src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" crossorigin="anonymous"'
])->view('welcome_head')
->view('welcome_message')
->view('welcome_foot');
}
}
Class Someone extends MY_Controller
{
public funtion _init() // Commonly used functions instead of __construct ()
{
// code...
}
public function index()
{
$this->load->view('someone');
}
}
Class Someone extends MY_Controller
{
public function __construct()
{
parent::__construct();
$this->load->driver('straight');
}
public function index()
{
$this->load->view('someone');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.