I have an php application in Codeigniter. There are 3 pages model.php , controller.php and view.php
model.php
<?php
class Activity_insert extends CI_Model {
public function activity()
{
echo "it works";
}
}
?>
controller.php
public function viewemp($q = NULL)
{
$this->load->helper('form');
$this->load->library('form_validation');
$this->load->model('activity_insert');
$data['activity_log'] = $this->activity_insert->activity();
$this->load->view('header');
$this->load->view('sidebar');
$this->load->view('success',$data);
$this->load->view('footer');
}
view.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>GATT</title>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
</div>
</body>
</html>
after compiling my view page ahowing like this
it works <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>GATT</title>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
</div>
</body>
</html>
data is coming at starting of page. and if I did not call $activity_log anywhere in view.php it still showing same text "it works" at very begining of page. please help to resolve it.