Cakephp5 Paginate with CustomFinderOptions

Hi,

Based on Pagination - 5.x

I couldn’t get the passed params in my finder

// in my controller
$customFinderOptions = [
    'tags' => 'here are my tags'
];
$settings = [
    'finder' => [
        'PricesForListing' => $customFinderOptions
    ]
];
$c_allPrices = $this->paginate($this->Prices, $settings );
// in my Model/Tables/PricesTable.php
public function findPricesForListing(Query $query, array $tagged = []) {

    debug($tagged);// outputs an empty array
    return $query->find('all')->where(['created > ' => new \Cake\I18n\DateTime('2 months ago'),]);

}

Am I missing something ?

why is it ‘tags’ but $tagged?
Those should be the same..

Otherwise you an also use an options array with that as key, see

Sorry, i think I misunderstood the docs. I should pass the finder-variables as such :

$settings = [
    'limit' => 2,
];
$c_allPrices = $this->paginate($this->Prices->find('PricesForListing', ['data' => 'my data']), $settings );