src/Controller/Component/CrudComponent.php
public function viewVar($action, $viewVar = null)
    {
        if (is_array($action)) {
            foreach ($action as $realAction => $realViewVar) {
                $this->action($realAction)->viewVar($realViewVar);
            }

            return;
        }

        $this->action($action)->viewVar($viewVar);
    }
public function viewVar($action, $viewVar = null)
    {
        if (is_array($action)) {
            foreach ($action as $realAction => $realViewVar) {
                $this->action($realAction)->viewVar($realViewVar);
            }

            return;
        }

        $this->action($action)->viewVar($viewVar);
    }
public function viewVar ( $ action , $ viewVar = null ) { if ( is_array ( $ action ) ) { foreach ( $ action as $ realAction => $ realViewVar ) { $ this -> action ( $ realAction ) -> viewVar ( $ realViewVar ) ; } return ; } $ this -> action ( $ action ) -> viewVar ( $ viewVar ) ; }
Change the viewVar name for one or multiple actions.

To map multiple action viewVars in one go pass an array as first argument and no second argument.

@param string|array $action Action or array of actions.
@param string|null $viewVar View var name.
@return void
@throws \Crud\Error\Exception\ActionNotConfiguredException
@throws \Crud\Error\Exception\MissingActionException
Change the viewVar name for one or multiple actions .