I have a lot of models using `created_time`. And I want all of the GridViews to show the models sorted by `created_time` DESC.

Right now I write something like this

```
$dataProvider = new \yii\data\ActiveDataProvider([
        'query' => MyModel::find(),
        'sort' => [
            'defaultOrder' => [
                'created_time' => SORT_DESC
            ]
        ],
    ]);

```

Instead of writing all of `sort` configuration I tried ways below but nothing works.

1. Using container

```
\Yii::$container->set(\yii\data\ActiveDataProvider::class,
        [
    'sort' => [
        'defaultOrder' => [
            'created_time' => SORT_DESC
        ]
    ]
]);

```
2. Overriding the `sort` in extended class.

```
class ActiveDataProvider extends \yii\data\ActiveDataProvider {

    public $sort = [
        'defaultOrder' => [
            'created_time' => SORT_DESC
        ]
    ];

 }

```
3. Overriding before `init()` in the extended class works, but it won't work if the instantiation tries to override again.

```
class ActiveDataProvider extends \yii\data\ActiveDataProvider {
    public function init() {
        $this->sort = [
            'defaultOrder' => [
                'created_time' => SORT_DESC
            ]
        ];
        parent::init();
    }

}

//but this won't work if I want to use the ascending
$dataProvider = new \app\components\data\ActiveDataProvider([
    'query' => MyModel::find(),
    'sort' => [
        'defaultOrder' => [
            'created_time' => SORT_ASC
        ]
    ],
]);

```