Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responders and the CI framework #4

Open
lordmatt opened this issue Apr 26, 2013 · 1 comment
Open

Responders and the CI framework #4

lordmatt opened this issue Apr 26, 2013 · 1 comment

Comments

@lordmatt
Copy link

I have a whole load of models and other important business and database logic in the usual places in CI. Your CJAX thing is supposed to provide the existing framework with AJAX access right?

The way I have things set up currently - following your examples - is a folder called responses which has a file called login.php and a class called login all the logic for it is still in a model. Surely I would be better of using a controller?

In a response class I have no access to the Codeigniter framework which leaves CI mostly way out in the cold. So (1) CI is mostly pointless or (2) CJAX is just for pretty stuff but can't handle the heavy lifting of a real AJAX system or (3) you fully intended for CJAX and CI to work together and have been keeping this a secret.

So I do not have to spend the next two days reinventing the square wheel what is the process you intend or suggest to allow access to CI framework tools and helpers? At the moment response classes look more like really crap imitations of controllers.

Tell me I'm wrong but this really looks like it's been hacked onto CI in a way that ignores everything about CI that makes it worth using rather than designed to work within it.

@ajaxboy
Copy link
Owner

ajaxboy commented May 28, 2013

In your first question,

I apologize for any issues you may have experienced.

It would be reasonable to use an Ajax Controller if the way you are login-in is through AJAX, otherwise you should use your regular controller in the Controllers directory.

The main purpose of the separation is to maintain your ajax functionality in an organized way, away of all the misfits and clutter of code that other libraries/controllers and such may cause.

With that mentioned above, there is a way to route your Ajax Controllers to the same CodeIgniter controllers, but that would defeat the design purpose.

In your class inside response, you should have FULL access to the codeigniter framework. The examples included in the installation package provide at least 2 examples extending the existing CI Controller, that said there shouldn't be any problem using all your CI code inside your responses. It is designed to work as effective as the core CI functionality works.

And hate to say it but, yes you were wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants