Welcome Guest, Not a member yet? Register   Sign In
Help with codeigniter and json messanges
#1

[eluser]Unknown[/eluser]
ok here's the probleme: I have a controller with a method that (with the help of a model) lets me eliminate a row in the database and return a json object to the browser.

The probleme it's that the string never gets to the browser, i put some log messages in each step of the process, even in the _output method of the controller and i can still see the message generated by it, but it doesn't put it in the ouput;

Oh, i forget to tell you guys that i was using the $.ajax method to do it, but when i try to acces the function in the controller in the url (exj: www.algo.com/libros/eliminar/25) it works just fine.

Can anyone help me with this one?
#2

[eluser]Unknown[/eluser]
this is the minimiced version of the controller that i used:

class Libros extends Controller
{
function Libros()
{parant::Controller();}

function eliminar($id)
{
$query_json = $this->Datalayer->eliminar_libro($id);

log_message('info', 'Libros/Eliminar: '.$query_json);

echo $query_json;
}

function _output($output)
{
log_message('info', 'output: '.$output);

echo $output;
}
}
#3

[eluser]bretticus[/eluser]
I recommend 2 tools for you:

http://getfirebug.com/

Firebug is enough for seeing what AJAX is doing and what your server is returning to it. However, you can do some cool internal PHP logging with a firebug plugin called firephp:

http://www.firephp.org/




Theme © iAndrew 2016 - Forum software by © MyBB