ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE & Ajax

June 05, 2012 10:24am

Subscribe [1]
  • #1 / Jun 05, 2012 10:24am

    Gazley

    15 posts

    Hi

    Trying to make a decision between Drupal 7 and EE.

    If I developed Ajax/JS in a template for client side execution, what is the story for callbacks to the EE backend?

    In a standard MVC type web application, I might call a RESTfull endpoint and execute a method in a controller to do some kind of update, or return JSON or HTML to update the DOM on the callback.

    This whole area confuses me with what I have read about EE as I can’t see the “end point”.

    Many thanks.

  • #2 / Jun 05, 2012 12:00pm

    Dan Decker

    7338 posts

    Hi Gazley,

    Thank you for your interest in ExpressionEngine and welcome to the Forums!

    With ExpressionEngine, think of the template group as the controller and the template as the method. Kind of a loose association, but it will help illustrate.

    Now, imaging you have you data stored in an EE channel and you need that data returned to you via an AJAX call - you would simply format your channel entries output in JSON format and “hit” the URL to the template-group/template and it would return your data.

    ExpressionEngine also has a constant available that can detect if a call was made via AJAX. You can use that to test if you need to.

    Have a look at our Getting Started video and you might look over the Developer Documentation as well.

    Let me know if you have any questions!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases