[eluser]Unknown[/eluser]
Hello,
I have noticed a problem in codeigniter and I'm wondering what is causing it.
To replicated the error, from a fresh install of codeigniter I open up the welcome controller and edit it so it is as follows:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
$this->load->view('test');
}
}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
If I then open up views/test.php and put in some html so the file looks like this:
Code:
<html>
<head>
<meta http-equiv="content-type" charset="utf-8">
<title>Test</title>
</head>
<body>
<p>Test</p>
</body>
</html>
If I then load the application in the browser and view source, I can see the contents of views/test.php, but there is a blank line after </html>. In the browser 'view source' I have 10 lines when views/test.php is only 9.
My question is how do I stop this blank line and only send the browser the code which is in view/test.php and get rid of the blank line?