Is there a (simple) way to echo some variables from a Codeigniter controller to the browser console?
Something like
public function my_controller_method() {
if (testing_out_something) {
$result = "looks like it works";
$this->log_to_javascript_console->write($result);
}
}
I saw this javascript class but it looks like it's more for jQuery, I just want to do something simple for debugging purposes.
I guess another way would be to send it to a view, but I don't want my view to change at the moment, I just want to make sure my data is being sent.
Is there a (simple) way to echo some variables from a Codeigniter controller to the browser console?
Something like
public function my_controller_method() {
if (testing_out_something) {
$result = "looks like it works";
$this->log_to_javascript_console->write($result);
}
}
I saw this javascript class but it looks like it's more for jQuery, I just want to do something simple for debugging purposes.
I guess another way would be to send it to a view, but I don't want my view to change at the moment, I just want to make sure my data is being sent.
Share Improve this question asked Aug 17, 2012 at 12:45 redconservatoryredconservatory 22k41 gold badges122 silver badges193 bronze badges1 Answer
Reset to default 2this links may help you :
http://www.codeforest/debugging-php-in-browsers-javascript-console
http://sarfraznawaz.wordpress./2012/01/05/outputting-php-to-browser-console/