Chodzi mi np. o takie coś:
$this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); if(!$this->getRequest()->isXmlHttpRequest()) return; if ($this->getRequest()->isPost()) { $form = new Default_Form_ContactForm(); if ($form->isValid($this->getRequest()->getPost())) { ------------------------------------------------------------------ TU JAKIEŚ ZADANIA, KTÓRE SĄ UNIKALNE DLA AKCJI ------------------------------------------------------------------ } $this->view->form = $form; } else { throw new Exception('Błędny adres!', 404); }
Jak widać wszystkie te linie mogą być spokojnie raz zaimplementowane, a nie powtarzane tylko dlatego, że coś się różni w tym bloku.
Pozdrawiam