You can use a cable, the Lightning to VGA Adapter (UK) is the one you want for an iPad Mini or the iPad 4. £27.58
For the iPad 2 you want the Apple 30-pin to VGA Adapter £17.72
Or you can download an application that runs on your mac or pc.
This allows the computer to act as a Apple TV and you can project wirelessly to the computer and connect the computer to a projector in the usual way.
Two of these apps: