Welcome Guest, Not a member yet? Register   Sign In
Bootstrap integration issue
#1

Greetings, I have installed bootstrap through composer, and I have registered in the autoload the bootstrap path in the vendor folder, however when using the base_url() method I cannot access the path of the css file. Thanks in advance.
Reply
#2

copy all related file to public folder. its better.
Reply
#3

public
-- assets
---- bootstrap
---- css
---- js
---- vendor
---- etc;
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

Hello, could you post your root directory path in some VCS like github or gitlab?
maybe I can help you?
Reply
#5

if something is installed via composer, you shouldn't have to manually "register" anything , its done automatically

But which bootstrap ? I use SASS which is in vendor but i use gulpfile to move to public /css
Code:
function do1()
{
    
    
return gulp

       .src('node_modules/bootstrap/scss/*.scss    ')//takes scss from node modules & puts css in ui folder
       .pipe(sass())
       .pipe(concat('bootstrap.css'))
       .pipe(gulp.dest('public/css'))
    }


Then because i want to have some custom stuff with bootstap i do this in a file called style.css


Code:
@import url("bootstrap.css");
@import url("custom.css");
@import url("font-face.css");

The order means that same elements in both bootstrap and custom.css, custom will overwrite those of bootstrap


then in my single layout page i referecen the style.css which is in public/css dirs liek this

Code:
<link  rel="stylesheet" type="text/css" href="<?php echo base_url('css/style.css'); ?>   " />
CMS CI4     I use Arch Linux by the way 

Reply




Theme © iAndrew 2016 - Forum software by © MyBB