ueronica
ueronica

Reputation: 75

Cannot get CSS script to work with Kohana framework

I cannot get my CSS stylesheet to work with the Kohana framework that I downloaded and am using. I have been Googling nonstop for an hour now, and the solutions that others have suggested do not seem to fix my problem. This is the line of code that I have in my index.php file:

<?php echo HTML::style('/Applications/MAMP/htdocs/MOOCinator/media/css/bootstrap.css'); ?>

I have tried plain HTML as well as using the relative path for the CSS file. The CSS file's permissions allow it to be read by everyone. My webpage displays exactly as it should in the browser except for the CSS. Suggestions on how to fix this, please?

Thanks!

Upvotes: 0

Views: 422

Answers (2)

AmazingDreams
AmazingDreams

Reputation: 3204

As falinsky stated all css resource files should be included as

<?php echo HTML::style('media/css/bootstrap.css'); ?>

From the comments under the other answer we 'debugged' the problem.

Your site url is not set correctly. This is how I got things .gitignore friendly.

// File application/bootstrap.php
$config = include(APPPATH .'config/environment.php');

Kohana::init(array(
    'base_url'    => $config['base_url'],
    'index_file'  => $config['index_file'],
));

Config file

// File application/config/environment.php
return array(
    'base_url'   => 'http://localhost/project/',
    'index_file' => FALSE,
);

I made a copy of this file as example.environment.php. In my gitignore I have

*
!.gitignore
!example.*

As to ignore all files except anything starting with example and the .gitignore file itself.

This is how I manage all my environment specific settings. Cookie, session, encryption hash, database, etc.

Upvotes: 2

falinsky
falinsky

Reputation: 7438

<?php echo HTML::style('media/css/bootstrap.css'); ?>

please read documentation carefully

Upvotes: 2

Related Questions