Welcome Guest, Not a member yet? Register   Sign In
CSS and Images with CodeIgniter
#1

[eluser]AdobeDelight[/eluser]
On my controller home.php, i have this simple line:

Code:
<?php
class Home extends Controller {

    function Home()
    {
        parent::Controller();    
    }
    
    function index()
    {
        $data['message'] = 'Hello World';
        $this->load->view('home_view', $data);
    }
}
?>

On my view file home_view.php, i have this:

Code:
<html>
<head>
<title>myApp</title>
<link rel="stylesheet" type="text/css" href="styles.css" media="screen" />
</head>
<body>
<?=$message?>
</body>
</html>

When i loaded the page, i noticed that the style.css was not getting loaded properly, then i changed the stylesheet href to :

<link rel="stylesheet" type="text/css" href="system/application/views/styles.css" media="screen" />

and this worked. Does this means, from now on, i have keep entering "system/application/views/" front of all my css and images? Is there not a easier way of doing this?


Messages In This Thread
CSS and Images with CodeIgniter - by El Forum - 10-10-2007, 07:36 PM
CSS and Images with CodeIgniter - by El Forum - 10-10-2007, 07:46 PM
CSS and Images with CodeIgniter - by El Forum - 10-10-2007, 11:21 PM
CSS and Images with CodeIgniter - by El Forum - 10-10-2007, 11:28 PM
CSS and Images with CodeIgniter - by El Forum - 10-11-2007, 01:14 AM
CSS and Images with CodeIgniter - by El Forum - 10-11-2007, 11:02 AM
CSS and Images with CodeIgniter - by El Forum - 10-22-2007, 05:00 AM
CSS and Images with CodeIgniter - by El Forum - 10-22-2007, 05:21 PM
CSS and Images with CodeIgniter - by El Forum - 11-13-2007, 03:30 AM
CSS and Images with CodeIgniter - by El Forum - 11-17-2007, 04:38 AM
CSS and Images with CodeIgniter - by El Forum - 11-17-2007, 06:03 AM
CSS and Images with CodeIgniter - by El Forum - 11-17-2007, 07:36 AM
CSS and Images with CodeIgniter - by El Forum - 03-29-2008, 06:21 AM
CSS and Images with CodeIgniter - by El Forum - 10-10-2008, 09:39 AM
CSS and Images with CodeIgniter - by El Forum - 10-25-2009, 12:14 AM
CSS and Images with CodeIgniter - by El Forum - 10-25-2009, 12:32 AM
CSS and Images with CodeIgniter - by El Forum - 01-15-2010, 10:58 PM
CSS and Images with CodeIgniter - by El Forum - 01-16-2010, 06:55 PM
CSS and Images with CodeIgniter - by El Forum - 05-19-2010, 06:11 PM
CSS and Images with CodeIgniter - by El Forum - 05-19-2010, 06:23 PM
CSS and Images with CodeIgniter - by El Forum - 01-30-2011, 09:14 PM
CSS and Images with CodeIgniter - by El Forum - 06-06-2011, 01:45 AM
CSS and Images with CodeIgniter - by El Forum - 06-06-2011, 01:46 AM
CSS and Images with CodeIgniter - by El Forum - 06-06-2011, 04:31 AM
CSS and Images with CodeIgniter - by El Forum - 06-18-2011, 06:14 PM
CSS and Images with CodeIgniter - by El Forum - 06-19-2011, 07:09 AM
CSS and Images with CodeIgniter - by El Forum - 06-21-2011, 08:24 AM
CSS and Images with CodeIgniter - by El Forum - 04-10-2012, 12:50 PM
CSS and Images with CodeIgniter - by El Forum - 11-08-2013, 10:55 AM
CSS and Images with CodeIgniter - by El Forum - 11-08-2013, 11:29 AM
CSS and Images with CodeIgniter - by El Forum - 02-21-2014, 11:50 AM
CSS and Images with CodeIgniter - by El Forum - 02-21-2014, 12:23 PM
CSS and Images with CodeIgniter - by El Forum - 02-21-2014, 12:57 PM
CSS and Images with CodeIgniter - by El Forum - 02-21-2014, 02:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB