Codecycler
Codecycler

@Sylwia, What are you trying to achieve?

You can always just call ->count(); on the query to know exactly how many results there are.

Codecycler
Codecycler

Take a look at the docs for the listExtendQuery function. You could always set a variable you could use in the index function.

https://octobercms.com/docs/backend/lists#extend-model-query

Codecycler
Codecycler

The controller class is just a php class. You can easily count the results in the query and save it to a variable in the controller. Let’s say $this->countRecords = $query->count().

Then just use the $this->countRecords variable in the index method.

Codecycler
Codecycler

Take a look at this file: /modules/backend/widgets/Lists.php. There should be a $records variable available so I think you can do the following:

$recordsCount = $this->vars[‘records’]->count();

1-9 of 9