CodeIgniter Forums
Codeigniter and Bootstrap installation using composer - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Codeigniter and Bootstrap installation using composer (/showthread.php?tid=83607)



Codeigniter and Bootstrap installation using composer - JamesHimmerla - 10-10-2022

I have created a Codeigniter project and installed Bootstrap library using composer. I use composer create-project CodeIgniter/framework [project-name] for omegle.2yu.co composer installation and composer require twbs/bootstrap for Bootstrap library. I want to how I compile this project? How I use Bootstrap into view folder? and after completing the project what will be the deployment process?


RE: Codeigniter and Bootstrap installation using composer - Luís Andrade - 10-12-2022

(10-10-2022, 03:22 AM)JamesHimmerla Wrote: I have created a Codeigniter project and installed Bootstrap library using composer. I use composer create-project CodeIgniter/framework [project-name] for composer installation and composer require twbs/bootstrap for Bootstrap library. I want to how I compile this project? How I use Bootstrap into view folder? and after completing the project what will be the deployment process?

Hi, James Himmer

It's easy. Don't take hard ways.

I don't know if you already know how to code Bootstrap. Anyway, let's go...

The basic bootstrap for view without download bootstrap or use composer:
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" ></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" >

...CODE....

I create libraries for these things to keep the code clean and save programming work

Do not complicate things. Keep it simple!

Do your best, always!


RE: Codeigniter and Bootstrap installation using composer - Langriala - 10-18-2022

What I do, is that I use a "main" template, which includes the css, js, head, body, etc... Then, inside my body tag, I do the $this->load->view('folder/function', $data); which processes the internal view... Do I make sense ???

Main View:

<html>
<head>
<?php $this->load->view('html/head', $view_data); ?>
</head>
<body lang="es">

<div class="container">

<?php $this->load->view('html/header')?>

<div class="contenido">

<?php if (isset($which_view)) $this->load->view($which_view, $view_data)?>

</div>
<?php $this->load->view('html/footer');?>
</div>
</body>
</html>


RE: Codeigniter and Bootstrap installation using composer - KamaalJema - 11-04-2022

I want to include/use bootstrap in all my controllers/views without having to load each css/js in each view file, so I have done this:

Installed Composer Bootstrap

composer require twbs/bootstrap

My Index Controller:

public function index() {
    // Composer Autoloader
    require VENDORPATH.'autoload.php';
    require_once BASEPATH.'core/CodeIgniter.php';

    echo '<div class="section jumbotron text-center">Yu in index son.</div>';
}
VENDORPATH = myhomefolder../vendor/

vendor/autoload.php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit9d54f40b1177ed0ebd8d1d378ec06d06::getLoader();
/composer.json

{
  "require": {
    "twbs/bootstrap": "^3.3"
  }
}
I don't know what to do now, I have searched all the web but it only says things about other packages or something not related and Im stuck in this right now, if someone in omegle shagle voojio advance can help, I would appreciate, thank you.