Newer Version Available

This content describes an older version of this product. View Latest

Creating an Apex Server-Side Controller

Use the Developer Console to create an Apex server-side controller.
You must use a Developer Edition organization with a registered namespace.
  1. Click Your name | Developer Console.
  2. Click File | New | Apex Class.
  3. Enter a name for your server-side controller.
  4. Click OK.
  5. Enter a method for each server-side action in the body of the class.
  6. Click File | Save.
  7. Open the component that you want to wire to the new controller class.
  8. Add a controller system attribute to the <aura:component> tag to wire the component to the controller. For example:
    1swfobject.registerObject("clippy.codeblock-0", "9");<aura:component controller="myNamespace.MyApexController" >