Welcome Guest, Not a member yet? Register   Sign In
Css file inclusion problem
#1

[eluser]Bluemagix[/eluser]
I have one controller called blog.php
as follows

Code:
<?php
class Blog extends Controller {
    function index()
    {
        $this->load->helper(array('form', 'url','security'));
        $this->load->library('form_validation');
        $data['header'] = 'header'; // name of the view
        $this->load->library('template');
        $this->load->view('template', $data);
    }
    function home()
    {
        $this->load->helper(array('form', 'url','security'));
        $this->load->library('form_validation');
        $data['header'] = 'header'; // name of the view
        $this->load->library('template');
        $this->load->view('template', $data);
        $this->load->view('home');    // name of the view
    }
    function forum()
    {
        $this->load->view('forum'); // name of the view
   }

http://localhost/blog is giving me the output what i want
but it seems that css file is not added for
http://localhost/blog/index
or http://localhost/blog/home

why it is so??
n what is the diffrance between
http://localhost/blog/ and http://localhost/blog/index
#2

[eluser]JoostV[/eluser]
You probably use a relative path to include your css file. You need to use the full path or set a base href tag. You'll find a solution here: http://ellislab.com/forums/viewthread/98267/#496496

There is no difference between yourdomain.com/blog and yourdomain.com/blog/index. Both URLs call the index function in your blog controller.
#3

[eluser]John_Betong[/eluser]
 
Try the following code and spot the difference in your two views:
Code:
<html>
    ...
    ...
    <?php echo getcwd() ?>
    ...
    ...
  </html>
 
 




Theme © iAndrew 2016 - Forum software by © MyBB