Phineas and Ferb the Movie: Across the 2nd Dimension (2011)

IMDB: 7.4/10

Phineas and Ferb discover that Perry is a secret agent, and they all get stuck in an alternate dimension where Doofenschmirtz is the ruler of the tri-state area.