Actually I am coding Ajax and want to make a xml code in the controller file.
How could it be possible to write xml code in the controller file?
Actually I am coding Ajax and want to make a xml code in the controller file.
How could it be possible to write xml code in the controller file?
sample of what you want: in your CI controller:
class XML extends CI_Controller {
public function my_function(){
//your xml code here
echo $xml_code; //echo your output
}
}
and in your script you might put something like this:
$(function() {
$.ajax({
url: '/XML/my_function/',
type: 'POST',
dataType: 'string',
success: function(response){
//do what you want for response
});
});