It's definitely possible to use a PS3 controller on a jailbroken iPhone. You need the $7 app Blutrol and the SixpairTool for MacOS X. Before I rewrite the instructions, please simply refer to http://lifehacker.com/5991266/how-to-use-a-gamepad-for-any-ios-game-not-just-emulators.

EDIT: In a nutshell
=====================

GETTING READY:

First, you need an jailbreak your iOS device. Then, download the App ***Blutrol*** ([http://apt.thebigboss.org/mobileweb/onepackage.php?bundleid=ch.ringwald.blutrol&db=][1]), which currently costs $6.99. In order to use the PS3 controller, you will need an additional app for MacOS: SixPairMac ([ringwald.ch/cydia/blutrol/SixPairMac-v1.0.zip][2])

SETUP for PS3 controllers:
Connect the PS3 controller via USB Cable, and the iOS device (via lightning cable or 30-pin cable) to your Mac. Click the button "Pair Controller to iPad" in SixPairMac. Now, open Blutrol on your iOS device and select the PS3 controller.


  [1]: http://apt.thebigboss.org/mobileweb/onepackage.php?bundleid=ch.ringwald.blutrol&db=
  [2]: http://ringwald.ch/cydia/blutrol/SixPairMac-v1.0.zip