Harsha M V
Harsha M V

Reputation: 54989

CakePHP Validation Error Message

I am trying to modify the way CakePHP shows the error message. Below is the generic template that it uses to display errors

<div class="error-message">Please enter at least 3 characters.</div>

I want to style the error like below.

<label class="error">Please enter at least 3 characters.</label>

Upvotes: 3

Views: 2657

Answers (2)

Harsha M V
Harsha M V

Reputation: 54989

this did the job. i was missing the text parameter.

 <?php echo $this->Form->error('name', null, array('wrap' => 'label', 'class' => 'error')); ?>

Upvotes: 2

Abdulhakim Haliru
Abdulhakim Haliru

Reputation: 11

echo $this->Form->label("Please enter at least 3 xter",array('class'=>'error');

Upvotes: 1

Related Questions