Welcome Guest, Not a member yet? Register   Sign In
SimpleXML to return a few items at a time
#11

[eluser]ModernM[/eluser]
Totally agree. Learning here! =)

Question,
Since the $CatID is dynamic, meaning its changeing what the cURL requests in the model are, is this still the best method? If I run this in a controller with the cURL requests and append the cat id to the URL I get that category of items returned. If now the model have this value, how does the controller send this to the Model to request the appropriate category?

I have go the model to load the drivers and cache, and it appears if I put a static value I get some sort of positive response, IE no errors, but as I move forward I am wondering how to adjust for the change in data requests.

Maybe I should point out this fact, the system I am talking to only allows for search queries from what I can tell and those queries are returned in XML.

I really hope I am working in the right direction.
#12

[eluser]pickupman[/eluser]
Hopefully you have a mapping of the category ids you can request. You don't want to hard code a single category id. What logic should be in place, if the controller passes a catid to the model, the model runs and receives an error for invalid catid, the model should return FALSE or something. Then the controller should pass some sort of error message to the view. Like "Invalid Category" or "Category not found".

You always need to test input from the url, because you leave yourself open to mischief otherwise.
#13

[eluser]ModernM[/eluser]
Well i have finally worked my way through this, very stoked. I know its not perfect because I could not figure out the cache driver, but right now the site is up and working. I would like to move some of the code to its appropriate place, like the model for the data, but I am not sure how to. I guess its kinda hacked together, id love to share my work if anyone is interested.

Thanks again for all your help here pickupman!

Buy you a drink!
#14

[eluser]pickupman[/eluser]
Glad you were able to get it working. Sounds like when you get your feet a little more wet you can go back and clean things up a bit.
#15

[eluser]Unknown[/eluser]
Greetings,

This thread is very similar to what I'm trying to do. I'm working on my first module for ExpressionEngine.

Is curl the only way to retrieve "get" or "post" data from a remote host within Expression Engine? If I have to include curl in a module distribution, since I can't assume users of the module would have it already, then what is the best way to do that?

I'm also looking at parsing a very large xml file retrieved from a remote server. I was going to use the "xmlparser" library that is part of Exp Eng. But the examples I've come across seem to assume a local file on the server.

Any help or direction would be appreciated.

Thanks,
Bob.
#16

[eluser]pickupman[/eluser]
@bob,
You may have better luck posting in the EE forum or asking something relevant to the current thread.




Theme © iAndrew 2016 - Forum software by © MyBB