I have a controller in codeigniter pages.php
class Pages extends CI_Controller {
public function view($page = 'home')
{
$this->load->view('header');
echo("<br>");
$this->load->model("math");
echo $this->math->add(1,2);
}
}
The model: math.php
class math extends CI_Controller
{
public function add($val1,$val2){
return $val1+$val2;
}
}
The view: header.php
<html>
<head>
<title>fashion and style</title>
</head>
<body>
<?php
echo("this is the header");
?>
As per the controller the code should output:
this is the header
number
but i get the output like:
number this is the header
Why?