You are here

public function ViewsMegarowController::getContentResult in Views Megarow 8

Returns the result of invoking the sub-controller.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request object.

mixed $controller_definition: A controller definition string, or a callable object/closure.

Return value

mixed The result of invoking the controller. Render arrays, strings, HtmlPage, and HtmlFragment objects are possible.

1 call to ViewsMegarowController::getContentResult()
ViewsMegarowController::content in src/Controller/ViewsMegarowController.php
Controller method for Ajax content.

File

src/Controller/ViewsMegarowController.php, line 73

Class

ViewsMegarowController
Default controller for Ajax requests.

Namespace

Drupal\views_megarow\Controller

Code

public function getContentResult(Request $request, $controller_definition) {
  if ($controller_definition instanceof \Closure) {
    $callable = $controller_definition;
  }
  else {
    $callable = $this->controllerResolver
      ->getControllerFromDefinition($controller_definition);
  }
  $arguments = $this->controllerResolver
    ->getArguments($request, $callable);
  $page_content = call_user_func_array($callable, $arguments);
  return $page_content;
}