plik actions wyglada tak :
<?php public function validateFormularz($request) { $name = $request->getParameter('name'); // The name field is required if (!$name) { $this->getRequest()->setError('name', 'The name field cannot be left blank'); return false; } // The name field must be a text entry between 2 and 100 characters 'min' => 2, 'min_error' => 'This name is too short (2 characters minimum)', 'max' => 100, 'max_error' => 'This name is too long. (100 characters maximum)', )); if (!$myValidator->execute($name, $error)) { return false; } return true; } public function executeFormularz($request){ } public function handleErrorFormularz() { // Prepare data for the template // Display the form return sfView::SUCCESS; } ?>
szablon tak :
<?php use_helper('Validation') ?> <?php use_helper('Form') ?> <?php if ($sf_request->hasError('name')): ?> <?php endif; ?> ... </form>
po odpaleniu strony otrzymuje blad 505 - jak usune czesc odpowiedzialna za wyswietlenie komunikatu o bledzie
<?php if ($sf_request->hasError('name')): ?> <?php endif; ?>
stronka sie wyswietla ale brak komunikatu..