This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
g.frenken68086
You can change a controller's list behaviour. Adding the following code to your plugin's boot()
method should work:
\RainLab\User\Controllers\Users::extend(function (\RainLab\User\Controllers\Users $users) {
$users->listConfig = $users->mergeConfig($users->listConfig, [
'defaultSort' => [
'column' => 'created_at',
'direction' => 'desc',
],
]);
});
More examples: https://docs.octobercms.com/2.x/services/behaviors.html#detecting-utilized-extensions
Last updated
g.vanto67453
g.frenken68086 said:
You can change a controller's list behaviour. Adding the following code to your plugin's
boot()
method should work:\RainLab\User\Controllers\Users::extend(function (\RainLab\User\Controllers\Users $users) { $users->listConfig = $users->mergeConfig($users->listConfig, [ 'defaultSort' => [ 'column' => 'created_at', 'direction' => 'desc', ], ]); });
More examples: https://docs.octobercms.com/2.x/services/behaviors.html#detecting-utilized-extensions
Brilliant that works @g.frenken68086 - wasn't sure where in docs to find it, thanks!
1-3 of 3