public function setViewController($controller)
    {
        if (is_scalar($controller) || is_resource($controller)) {
            throw new InvalidArgumentException(
                'View controller must be an object, null or an array'
            );
        }

        $this->viewController = $controller;

        return $this;
    }
public function setViewController($controller)
    {
        if (is_scalar($controller) || is_resource($controller)) {
            throw new InvalidArgumentException(
                'View controller must be an object, null or an array'
            );
        }

        $this->viewController = $controller;

        return $this;
    }
public function setViewController ( $ controller ) { if ( is_scalar ( $ controller ) || is_resource ( $ controller ) ) { throw new InvalidArgumentException ( 'View controller must be an object, null or an array' ) ; } $ this -> viewController = $ controller ; return $ this ; }
Set a view controller for the template's context.

@param ViewableInterface|object|array|null $controller A view controller to use when rendering.
@throws InvalidArgumentException If the controller is invalid.
@return self
Set a view controller for the template s context .