diff --git a/src/ViewModel.php b/src/ViewModel.php index 25797fa..a104415 100644 --- a/src/ViewModel.php +++ b/src/ViewModel.php @@ -8,7 +8,7 @@ class ViewModel implements Model, ContextAware { - protected string $_preferredView; + protected string $_defaultView; use ContextAwareTrait; use WithContextTrait; @@ -19,17 +19,17 @@ public function jsonSerialize() return empty($values) ? $this : $values; } - public function setPreferredView(string $viewClass) + public function setDefaultView(string $viewClass) { - $this->_preferredView = $viewClass; + $this->_defaultView = $viewClass; return $this; } public function createView(string $viewClass = null) { - if($viewClass === null && !empty($this->_preferredView)) + if($viewClass === null && !empty($this->_defaultView)) { - $viewClass = $this->_preferredView; + $viewClass = $this->_defaultView; } if($viewClass === '' || !class_exists($viewClass))