Find us on facebook

Showing posts with label CodeIgniter3. Show all posts
Showing posts with label CodeIgniter3. Show all posts

Apr 26, 2015

CodeIgniter3 - View folder structure

Commonly used files like header.php, footer.php, menu.php should be placed under views/templates.
Within any other view you can use these files following way.
<?php $this->load->view('templates/top'); ?>
<?php $this->load->view('templates/menu'); ?>

Or In the controller you can use them according to their placement.
$this->load->helper('url');
$this->load->library('AssetLoad');
$this->assetload->queue();
$this->load->view('templates/top');
$this->load->view('templates/menu');
$this->load->view('templates/main');
$this->load->view('templates/footer');

CodeIgniter - Assets


  • Place AssetLoad.php file in the folder application/libraries
  • Create folder called assets in root. (Same level as application and system folders)
  • Within assets folder, following structure should be there.

  • Within assets.ini file you can include following coding

; Asset loader manifest file

    [defaults]
      css[] = "http://127.0.0.5/CI/BATransfer/assets/css/site.css"
        css[] = "http://127.0.0.5/CI/BATransfer/assets/css/main.css"
          js[]  = "http://127.0.0.5/CI/BATransfer/assets/js/html5shiv.min.js"


          Within controller action you can use this library following way.

          $this->load->library('AssetLoad');
          $this->assetload->queue();