a simple rule should do it, add a rule in your urlManager like so
'<category:[\w-]+>/<id:\d+>/<article:[\w-]+>'=>'article/index',
// then in your controller action you can access it as
public function actionIndex($category, $article)
{
}
The issue with the above approach is, unless I’m mistaken it would conflict with the standard controller/action route. I’m guessing you’d want to create a rule class (http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html), prioritise it above the controller/action route, query the database to determine if it’s a correct article route base on the category/article param, and if not, continue.
You’d probably want to cache the database query as well, since it is a bit of unnecessary overhead querying the database every time before even knowing where to route the request.