public function newAction()
    {
        $form = $this->getServiceLocator()->get('playgrounddesign_theme_form');

        $request = $this->getRequest();
        $themeEntity = new themeEntity;

        if ($request->isPost()) {
            $data = array_merge(
                $request->getPost()->toArray(),
                $request->getFiles()->toArray()
            );

            $theme = $this->getAdminThemeService()->create($data, 'playgrounddesign_theme_form');
            if ($theme) {
                $this->flashMessenger()->addMessage('The theme "'.$theme->getTitle().'" was created');

                return $this->redirect()->toRoute('admin/playgrounddesign_themeadmin');
            } else {
                $this->flashMessenger()->addMessage('The theme was not created');

                return $this->redirect()->toRoute('admin/playgrounddesign_themeadmin');
            }
        }

        $viewModel = new ViewModel();
        $viewModel->setTemplate('playground-design/theme-admin/theme');

        return $viewModel->setVariables(array('form'           => $form,
                                              'automaticTheme' => 0));
    }
public function newAction()
    {
        $form = $this->getServiceLocator()->get('playgrounddesign_theme_form');

        $request = $this->getRequest();
        $themeEntity = new themeEntity;

        if ($request->isPost()) {
            $data = array_merge(
                $request->getPost()->toArray(),
                $request->getFiles()->toArray()
            );

            $theme = $this->getAdminThemeService()->create($data, 'playgrounddesign_theme_form');
            if ($theme) {
                $this->flashMessenger()->addMessage('The theme "'.$theme->getTitle().'" was created');

                return $this->redirect()->toRoute('admin/playgrounddesign_themeadmin');
            } else {
                $this->flashMessenger()->addMessage('The theme was not created');

                return $this->redirect()->toRoute('admin/playgrounddesign_themeadmin');
            }
        }

        $viewModel = new ViewModel();
        $viewModel->setTemplate('playground-design/theme-admin/theme');

        return $viewModel->setVariables(array('form'           => $form,
                                              'automaticTheme' => 0));
    }
public function newAction ( ) { $ form = $ this -> getServiceLocator ( ) -> get ( 'playgrounddesign_theme_form' ) ; $ request = $ this -> getRequest ( ) ; $ themeEntity = new themeEntity ; if ( $ request -> isPost ( ) ) { $ data = array_merge ( $ request -> getPost ( ) -> toArray ( ) , $ request -> getFiles ( ) -> toArray ( ) ) ; $ theme = $ this -> getAdminThemeService ( ) -> create ( $ data , 'playgrounddesign_theme_form' ) ; if ( $ theme ) { $ this -> flashMessenger ( ) -> addMessage ( 'The theme "' . $ theme -> getTitle ( ) . '" was created' ) ; return $ this -> redirect ( ) -> toRoute ( 'admin/playgrounddesign_themeadmin' ) ; } else { $ this -> flashMessenger ( ) -> addMessage ( 'The theme was not created' ) ; return $ this -> redirect ( ) -> toRoute ( 'admin/playgrounddesign_themeadmin' ) ; } } $ viewModel = new ViewModel ( ) ; $ viewModel -> setTemplate ( 'playground-design/theme-admin/theme' ) ; return $ viewModel -> setVariables ( array ( 'form' => $ form , 'automaticTheme' => 0 ) ) ; }
Creation d'un theme

@return array $array Passage des variables dans le template
form : formulaire qui correspond au theme
base : dossier qui correspond a la base du projet
Creation d un theme