code: public function getLoadedPage($default = null)
      {
          if (!$this->loadedPage) {
              if (is_callable($default)) {
                  $page = call_user_func($default, $this);
                  if ($page !== null) {
                      $this->setLoadedPage($page);
                  }
              }
  
              if (!$this->loadedPage) {
                  throw new NotFoundHttpException("There is no page currently loaded, but it was expected");
              }
          }
          return $this->loadedPage;
      }
docs: Returns the currently loaded page, or default to the specified callback for loading it.
  
  @param callable $default
  @return PageInterface
  @throws NotFoundHttpException