Jump to:

23486 Posts in 18995 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Executing controller function via AJAX

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 634 Views
  • theGermaniac
    Community Member
    82 Posts

    Executing controller function via AJAX Link to this post


    Is it possible to execute a controller function through Ajax? I want to get an array with objects the function fetches for me, but I have no clue how to execute the function.

    Thanks in advance.

    - Mario -

  • zenmonkey
    Community Member
    528 Posts

    Re: Executing controller function via AJAX Link to this post

    You can execute a controller function using the the $Page/$Action/$Parameter url pattern, where $Page is the URL, the $Action is the name of the controller function and $Parameter is an variable you may need to push.

    It should be noted that if you're trying to get data to display on the site your better off using RenderWith on the action that calls a template that renders the data and use it as a jQuery object

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.