Welcome Guest, Not a member yet? Register   Sign In
Integrating Bootstrap 5 into a CodeIgniter 4 Application
#4

This is one of my layouts, should give you and idea on how to include Bootstrap.
PHP Code:
<!doctype html>
<
html lang="en">

<
head>

 <!-- 
Required meta tags -->
 <
meta charset="utf-8">
 <
meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

 <
meta name="author" content="">
 <
meta name="description" content="">
 <
meta name="keywords" content="">

 <
link rel="icon" href="<?= base_url('assets/favicon.ico');?>">

 <
title>Layout</title>

 <!-- 
Bootstrap CSS -->
 <
link href="<?= base_url('assets/bootstrap/css/bootstrap.min.css');?>" rel="stylesheet">
 <
link href="<?= base_url('assets/bootstrap/icons/font/bootstrap-icons.css');?>" rel="stylesheet">

 <!-- 
Application CSS -->
 <
link href="<?= base_url('assets/css/web-app.css');?>" rel="stylesheet">

 <?= 
$this->renderSection('pageStyles'?>

</head>

<body>

 <?= view('_navbar'?>

 <main role="main" class="container">

 <?= $this->renderSection('main'?>

 </main><!-- /.container -->

 <!-- Optional JavaScript; choose one of the two! -->

 <!-- Option 1: jQuery and Bootstrap Bundle (includes Popper) -->
 <script src="<?= base_url('assets/jquery/jquery-3.7.1.min.js');?>"></script>
 <script src="<?= base_url('assets/bootstrap/dist/js/bootstrap.bundle.min.js');?>"></script>

 <?= $this->renderSection('pageScripts'?>

</body>
</html> 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: Integrating Bootstrap 5 into a CodeIgniter 4 Application - by InsiteFX - 04-29-2024, 04:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB