I would say if you're trying to create a web application use a framework like Yii(though Symfony looks pretty promising too IMHO)
If you're building a website, then MODx is fine (in fact awesome)
By website I mean the typical page-content relation (like most company websites)
By application I mean a less single-page content site, like a property search site or stackoverflow
MODx is my, hands down, favorite CMS for creating websites above 5 pages. But not so long ago I was faced with a similar question, framework or modx? I ended up going for a risky choice.. that is MODx Revolution. And regretted it... revo was quite new then and among all issues I've found it being slow the worst. I'm sure newer versions are faster, but you know what they say about first impressions. Anyway, Evo is still king in my books, but that aside...
Ok, well here's where it breaks down. The big reason why would not chose a CMS (even as good as modx:) is the database structure. In all CMSes the database is geared toward displaying pages, so you'll have the typical title,linkage,content,meta etc. While modx makes adding additional fields a breeze through template variables, creating many-to-many and one-to-many relationships is somewhere between impossible and really hard. (think delimiting strings, creating a separate table, creating widgets for custom templates to deal with multiple items). If you go with a framework you have to implement a lot of goodies most CMSes have already figured out, like fckeditor implementation, image uploader, user management, and so on.
Another advantage of a framework that creative routing is a lot simpler to implement. CMSes have a harder time with that, though not impossible.
But if you're comfortable with a framework (or wanting to use this to learn it) you might be better served going the framework route. That is if you trust yourself to implement better security than MODx.
good luck