From 2c7c6905fe3776fbdd82c6881df62db0d39a7d2e Mon Sep 17 00:00:00 2001 From: Brooke Bryan Date: Mon, 8 Nov 2021 09:57:58 +0000 Subject: [PATCH] Preferred - Default view --- src/ViewModel.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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))