/**
  * Prepare view renderer
  *
  * @param array $variables
  * @param \Contentinum\Options\PageOptions $pageOptions
  * @return \Zend\View\Model\ViewModel
  */
 public function buildView($variables, $pageOptions)
 {
     $view = new ViewModel($variables);
     $msg = false;
     $msgType = false;
     if (true === $this->flashMessenger()->setNamespace('mcwork')->hasCurrentErrorMessages()) {
         $msg = $this->flashMessenger()->setNamespace('mcwork')->getErrorMessages();
         $msgType = 'error';
     } elseif (true === $this->flashMessenger()->setNamespace('mcwork')->hasCurrentSuccessMessages()) {
         $msg = $this->flashMessenger()->setNamespace('mcwork')->getSuccessMessages();
         $msgType = 'success';
     } elseif (true === $this->flashMessenger()->setNamespace('mcwork')->hasCurrentWarningMessages()) {
         $msg = $this->flashMessenger()->setNamespace('mcwork')->getWarningMessages();
         $msgType = 'warning';
     }
     $view->setVariable('messages', $msg);
     $view->setVariable('msgtype', $msgType);
     if (1 === $pageOptions->getToolbar()) {
         $view->setVariable('toolbarcontent', $this->getServiceLocator()->get('mcwork_toolbar'));
     }
     if (1 === $pageOptions->getTableedit()) {
         $view->setVariable('tableeditcontent', $this->getServiceLocator()->get('mcwork_tableedit'));
     }
     if (null !== $pageOptions->getTemplate()) {
         $view->setTemplate($pageOptions->getTemplate());
     }
     return $view;
 }
 /**
  * Prepare view renderer
  *
  * @param array $variables
  * @param \Contentinum\Options\PageOptions $pageOptions
  * @return \Zend\View\Model\ViewModel
  */
 public function buildView($variables, $pageOptions)
 {
     $view = new ViewModel($variables);
     if (null !== $pageOptions->getTemplate()) {
         $view->setTemplate($pageOptions->getTemplate());
     }
     return $view;
 }
 /**
  *
  * @param \Contentinum\Options\PageOptions $pageOptions            
  * @param Zend\View\HelperPluginManager $viewHelperManager            
  */
 protected function setAppLocale($pageOptions, $viewHelperManager)
 {
     $dateFormat = $viewHelperManager->get('dateFormat');
     $dateFormat->setTimezone($pageOptions->getTimeZone())->setLocale($pageOptions->getLocale());
 }