Welcome Guest, Not a member yet? Register   Sign In
Can't return a simple FALSE value to controller....
#1

[eluser]J.P.C.[/eluser]
I don't know what wrong is happening but I have this function's controller:

function altaUsuario(){
$this->load->model('usuario');
echo $this->usuario->save2();
}



And this is the function's model:

function save2(){
return false;
}


The problem is that the function's Model doesn't return any value. And I realy need to return that false value back to the controller. This is really frustrating because it's a very simple and basic function to do and is not working Sad

The most weird is that I have a function's library working in the same way against a model, instead a controller, and it's working great returning false or true value to the model.

I already try with capitalized words like FALSE instead false, but I had the same result.

Thanks to everyone.
#2

[eluser]Colin Williams[/eluser]
So you are purposefully echoing FALSE. Why?

If that's all you do, all you will see is a blank white screen when you navigate to the altaUsuario page.
#3

[eluser]Dready[/eluser]
Please try like this :

Code:
function altaUsuario(){
$this->load->model(’usuario’);
var_dump($this->usuario->save2());
}
#4

[eluser]J.P.C.[/eluser]
Sorry if I didn't explained myself.

The thing is I can't evaluate the returning value in the controller function.
I don't want to echo the value but use it in an IF clause, just asking if the returning value is FALSE.

But the value returned is just blank.
It's weird because in BambooInvoice application, that I took as a model, they coded everything just like me and that application it's working fine I guess.


Dready:
That returned me bool(false) so I think this is returning some false value.
#5

[eluser]J.P.C.[/eluser]
Solved...

Was the FF cache troubling me.

Thanks for the replays anyway




Theme © iAndrew 2016 - Forum software by © MyBB