Welcome Guest, Not a member yet? Register   Sign In
Odd result when rendering the view
#1

[eluser]Unknown[/eluser]
Dear Experts,
I am a newbie to codeigniter and was trying to make my first application upon it but encountered some obstacles which upset me.
I was making some static pages. My controller is like this:
Code:
class Pages extends CI_Controller {

    public function view($page = 'home')
    {
  if ( ! file_exists(APPPATH.'views/pages/'.$page.'.php'))
  {
   // Whoops, we don't have a page for that!
   show_404();
  }
  
  $data['title'] = ucfirst($page); // Capitalize the first letter

  $this->load->view('pages/'.$page, $data);
    }
}
I have a home.php in application/view/pages.
I included some css and javascript in the head. But somehow when I read the code in browser, those css, javascript inclusion appear in the body.
Code:
<body id="home">
<link href="styles/blueprint/screen.css" rel="stylesheet" type="text/css" media="screen" />
<link href="styles/blueprint/print.css" rel="stylesheet" type="text/css" media="print" />
</body>
It is weird! Can anyone help me on this?

Regards,
Cato




Theme © iAndrew 2016 - Forum software by © MyBB