Welcome Guest, Not a member yet? Register   Sign In
AMCharts and CodeIgniter
#1

[eluser]Unknown[/eluser]
I just learned about CodeIgniter on the weekend and it's love at first sight, I've already ported about half of one my standalone apps into it very easily. But that's a whole different story.

The issue I'm running into is integrating AMCharts into this. I've created a controller which dynamically generates an XML document for the charts at

/charts/data/CHARTID.xml

I include this into the pages displaying the appropriate charts like so

Code:
so.addVariable("data_file", escape("/charts/data/<?php echo $chart["chartid"]; ?>.xml"));

But the problem is AMCharts adds a query to the end of this and says:
Error Loading File:
/charts/data/500.xml?1211859872093

When I go to that URL I get a "404 Page Not Found" error with code igniter. I've tried numerous routes and I've tried enabling query strings to no avail. Is there any way to route this properly without having to touch AMCharts?

Appreciate any guidance, thanks.
#2

[eluser]dmorin[/eluser]
Can you post a bit of your controller? Specifically, are you just calling the controller in the URL or are you calling a controller and the function. For example, if the controller is called gen_xml and you have the code to do that in the index function, try going to /gen_xml/index/. If you're already going to the function level, then the only other thing I can think of is try adding an additional url parameter so it would be /gen_xml/index/junk/. I'm not sure why (because I haven't bothered looking) but I know that eventually, after a certain number of parameters (separated by /), the querystring won't break the call.

Hope this helps.
#3

[eluser]Unknown[/eluser]
I managed to figure out a makeshift solution. amCharts was adding a timestamp on a query string to prevent caching and they have a setting to turn this off. The caching is obviously undesirable so I just made my own makeshift version by routing an extra URI at the end and dropping the time(); function into it, so now it's /charts/data/CHARTID/TIMESTAMP.xml

Works like a charm Smile




Theme © iAndrew 2016 - Forum software by © MyBB