Welcome Guest, Not a member yet? Register   Sign In
Codeigniter and Bootstrap installation using composer
#1

(This post was last modified: 11-08-2022, 11:12 PM by paulbalandan. Edit Reason: Spam links )

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?
Reply
#2

(This post was last modified: 10-12-2022, 10:09 AM by Luís Andrade.)

(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!
Reply
#3

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>
Reply
#4

(This post was last modified: 11-14-2022, 10:17 PM by KamaalJema.)

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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB