code: protected function addControls(Response &$response, Request $request, View $view)
      {
          $matches = array();
          
          while (preg_match("/\{(\w+)=(\w+)\}/", $response->getBody(), $matches)) {
              $controlIdentifier = $matches[1];
              $controlName = $matches[2];
              $currentBody = $response->getBody();
              
              if (! isset($this->viewParams[$controlIdentifier][$controlName])
  				|| ! $view->hasControl($controlIdentifier)) {
                  $response->setBody(str_replace($matches[0], '', $currentBody));
                  continue;
              }
              
              if ($this->viewParams[$controlIdentifier][$controlName] instanceof Control) {
                  $repl = $this->viewParams[$controlIdentifier][$controlName]->render($request);
              } else {
                  $control = $view->createControl($controlIdentifier);
                  $repl = $control->render($request, $this->viewParams[$controlIdentifier][$controlName]);
              }
              $response->setBody(str_replace($matches[0], $repl, $currentBody));
          }
      }
docs: Add the controls injected into view parameters
  
  @param Response $response
  The response rendered with controls
  @param Request $request
  The request
  @param View $view
  The View instance to use for rendering