I have a if else statement in codeigniter and try to direct different view but its gives error to me.However when i echo it prints to screen
This works !
public function kayitEmailOnay() {
$registrationCode = $this->uri->segment(3);
if ($registrationCode == '') {
echo "URLde onay kodu yok";
}
$registrationConfirmed = $this->kayitmodel->uyeOnay($registrationCode);
if ($registrationConfirmed)
echo "true";
else
echo "false";
}
This does not work
public function kayitSon() {
$this->load->view("kayit/kayitTamamla");
}
public function kayitHata() {
$this->load->view("kayit/kayitHata");
}
public function kayitEmailOnay() {
$registrationCode = $this->uri->segment(3);
if ($registrationCode == '') {
echo "URLde onay kodu yok";
}
$registrationConfirmed = $this->kayitmodel->uyeOnay($registrationCode);
if ($registrationConfirmed)
kayitSon();
else
kayitHata();
}
The error is that :

you should call your function like this: