Welcome Guest, Not a member yet? Register   Sign In
Ajax Request Modular Separation
#1

[eluser]Milos Dakic[/eluser]
I have been thinking about this for a while now, and is probably the main reason for holding one of my planned projects back.

What I’m trying to do is use ME5 to make my life easier in sorting things out into modules, but wanted the ability to extend a normal controller (or method) so that my modules will offer both normal HTML/CSS etc output as well as a JSON or XML output.

The reason I’m trying to do this is because from the start I want my application to be able to handle all the types of requests. And yes I could have just made another module which would handle my different requests, but I’m trying to keep everything in a single place (things related to each other).

I have looked at Michael Wales' code for handling AJAX requests, but would not like to have to put that into every controller (or method) that I am calling.

The layout that I’m trying (!?) to use is as follows:

Code:
+ application
  + modules
    + people
      + controller
        - People.php
        - Ajax_People.php

I have been thinking about maybe using hooks to redirect calls into another controller names “Ajax_People” or something similar that will reference the module name? Or would it be better inserting another module within the main module that I'm calling which would control the requests?

I would love to hear what people have done with this sort of thing, or what they think would be a good solution to my little (?!) problem.

Thanks heaps in advance.
#2

[eluser]Milos Dakic[/eluser]
Any thoughts would be great... =]




Theme © iAndrew 2016 - Forum software by © MyBB