• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic image/file display issues

#1
[eluser]elaniobro[/eluser]
I am a complete n00b to both CI and MVC framework. I am trying to get my images/css/etc.. to display properly in the browser.

However, the only thing that seems to work is actual text.

Do I need to set routes or something for the 'img' folder as well as the 'com' folder which has 'css','js','etc..' in it?

Here is the controller that I am using:
Code:
<?php
    class Home extends Controller{
        function Home()
        {
            parent::Controller();
            
        }
        
        
        function index()
        {
            $data['title'] = ' home';
            $data['heading'] = 'heading';

            $this->load->view('home_view');
        }
        
    }
?>
trying to put this in the view does not work:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html &gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;link type="text/css" src="com/css/global.css" rel="stylesheet" media="screen" /&gt;

&lt;/head&gt;
&lt;body&gt;

    <img src="img/logo.png"/>
    home
&lt;/body&gt;
&lt;/html&gt;

Thanks for any insight.

#2
[eluser]elaniobro[/eluser]
So it appears it was a scope issue an using:
Code:
&lt;?= base_url();?&gt;

Solved the trick, however how do I use base_url(); in a css file?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.