Indatus\Ranger\ContentType\HtmlView\ViewManager::goToView PHP Method

goToView() public method

public goToView ( $route, $parentAssociation, $additionalAssigns, $content )
    public function goToView($route, $parentAssociation, $additionalAssigns, $content)
    {
        $route_array = explode('.', $route);
        if (count($route_array) == 2) {
            $parent = $route_array[0];
            $action = $route_array[1];
            $controller = $parent;
        } elseif (count($route_array) == 3) {
            $parent = $route_array[0];
            $child = $route_array[1];
            $action = $route_array[2];
            $controller = $child;
        } else {
            throw new InvalidArgumentException("{$route} is not in correct format");
        }
        $assignStr = str_singular($controller);
        $assigns = array($assignStr => $content);
        if (!null_or_empty($parentAssociation)) {
            $assigns = array_merge($assigns, $parentAssociation);
        }
        if (!null_or_empty($additionalAssigns)) {
            $assigns = array_merge($assigns, $additionalAssigns);
        }
        return $this->view->make($controller . "." . $action, $assigns);
    }