setOption() public method

public setOption ( $value, RequestParams $allParams )
$allParams app\helpers\RequestParams
 public function afterInitialization()
 {
     parent::afterInitialization();
     $this->container->dispatcher->addListener('middleware.itemparpage.after', function ($event) {
         $page = new LastPagePaginatorMiddleware($event->getContainer());
         $page->setOption(1, $event->getParams()['allParams']);
     });
 }