Get a named parameter value from request
It is passed as a parameter to your function

public function actionView($post_id){
    Craft::dd($post_id);
}


Note: your parameter must have the same name like defined in your route. You can't access it with public function actionView($postId)