Phlyty\App::viewModel PHP Method

viewModel() public method

Always returns a new view model instance, cloned from the instance in $viewModelPrototype. If no prototype exists, creates one from View\MustacheViewModel.
public viewModel ( ) : object
return object
    public function viewModel()
    {
        if (empty($this->viewModelPrototype)) {
            $this->setViewModelPrototype(new View\MustacheViewModel($this));
        }
        $model = clone $this->viewModelPrototype;
        return $model;
    }