Set the view filename for the current request.

@throws \InvalidArgumentException thrown when the $action parameter is null or empty.
482017
public function setView() {
        if (!is_string($this->action) || empty($this->action)) {
            $errMessage = 'The action value must be a string and not be empty';
            throw new \InvalidArgumentException($errMessage, GeneralErrors::VALUE_IS_NOT_OF_EXPECTED_TYPE);
        }
        if (\Puzzlout\Framework\Core\Request::Init($this->app)->IsPost()) {
            //No view needed for Ajax calls.
            return;
        }
        $this->view = \Puzzlout\Framework\Core\ViewLoader::Init($this)->GetView();
        $this->page->setContentFile($this->view);
    }
16732
public function setName($name)
    {
        if (is_string($name) === false) {
            $msg = "The 'name' argument must be a string value, '" . gettype($name) . "' given.";
            throw new InvalidArgumentException($msg);
        }

        $this->name = $name;
    }
166023
public function setAction($actionName){
		$this->_action = new Elements\Hidden();
		$this->_action->setName('action');
		$this->_action->setVal($actionName);
		$this->_action->init();
	}
564917
public function setFilename($file)
    {
        $found = false;
        foreach (self::$_viewPaths as $path)
        {
            if ( ! $found && is_file($path . $file . self::$ext))
            {
                $found = $path . $file . self::$ext;
            }
        }

        if ( ! $found)
        {
            throw new ViewException('The requested view :file could not be found', [
                ':file' => $file,
            ]);
        }

        $this->_file = $found;
        return $this;
    }
503457
public function setActionType($action_type)
    {
        $allowedValues = $this->getActionTypeAllowableValues();
        if (!in_array($action_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'action_type', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['action_type'] = $action_type;

        return $this;
    }
793503
public function setAction(string $action)
    {
        $string = new CamelCase($action);
        $this->action = $string->camelize();
    }
1204877
private function callView()
    {
        if ($this->confirm("Create crud views for the $this->resource resource?")) {
            $views = config('generators.resource_views');
            foreach ($views as $key => $name) {
                $resource = $this->argument('resource');
                if (str_contains($resource, '.')) {
                    $resource = str_replace('.', '/', $resource);
                }

                $this->callCommandFile('view', $this->getViewPath($resource), $key,
                    ['--name' => $name]);
            }
        }
    }
584133
private function setViewPath()
    {
        $viewPath = (strpos($this->getTwigViewPath(), '.') == true) ?
            str_replace('.', DS, $this->getTwigViewPath()) :
            $this->getTwigViewPath();

        $this->setTemplateLocation($this->container->get('app.path').DS.$viewPath.DS);
    }
656101
public function setFilename($filename)
    {
        if (is_array($filename) && isset($filename['name'])) {
            $this->filename = $filename['name'];
        } else {
            $this->filename = $filename;
        }
    }
721252
public function setErrorTemplate($errorTemplate, $engine = null)
    {
        if (!\is_string($errorTemplate)) {
            throw new \InvalidArgumentException('Please use string as template name (Example: "folder.file").');
        }

        $this->errorTemplate = $errorTemplate;

        if ($engine) {
            $this->setEngine($engine);
        }
    }
1113450
protected function setFilename($filename)
    {
        if (is_string($filename)) {
            if (is_readable($filename)) {
                $this->filename = $filename;
            } elseif (file_exists($filename)) {
                throw new \InvalidArgumentException("File '$filename' isn't readable.");
            } else {
                throw new \InvalidArgumentException("File '$filename' doesn't exist.");
            }
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($filename). "' for argument 'filename' given."
            );
        }

        return $this;
    }
220540
public function changeViewName(Request $request, $databox_id)
    {
        if (null === $viewName = $request->request->get('viewname')) {
            $this->app->abort(400, $this->app->trans('Missing view name parameter'));
        }

        $success = false;

        try {
            $this->findDataboxById($databox_id)->set_viewname($viewName);
            $success = true;
        } catch (\Exception $e) {

        }

        if ('json' === $request->getRequestFormat()) {
            return $this->app->json([
                'success' => $success,
                'msg'     => $success ? $this->app->trans('Successful update') : $this->app->trans('An error occured'),
                'sbas_id' => $databox_id,
            ]);
        }

        // TODO: Check whether html call is still valid
        return $this->app->redirectPath('admin_database', [
            'databox_id' => $databox_id,
            'error'      => 'file-too-big',
        ]);
    }
1361611
protected function _setViewData($formName)
    {
        $this->controller()->request->data($formName, $this->parameters()->viewValues());
        $this->controller()->set('searchParameters', $this->parameters());
    }
1232633
public function setRemoteFilename(string $name) : void
    {
        if (empty($name)) {
            throw new Exception(
                'the filename can not be empty',
                Exception::INI_FILE_MISSING
            );
        }

        $this->remoteFilename = $name;
    }
523270
public function setName($name)
    {
        if (is_string($name) === true) {
            $this->name = $name;
        } else {
            $msg = "The 'name' argument must be a string, '" . gettype($name) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
959502
public function setAction()
    {
        // Constructs the current action method
        $this->action = strtolower($this->action) . 'Action';

        // Checks if the current action method exists in the current controller
        if (!method_exists($this->controller, $this->action)) {

            // Attributes the default action method to the current action method
            $this->action = self::DEFAULT_ACTION;
        }
    }
441458
public function setCurrentAction($action): void
    {
        if (!$action instanceof Action) {
            $action = $this->getAction($action);
        }
        $this->currentAction = $action;
    }