Refactor ViewVarsTrait::getView().