3

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>

2 Answers 2

2

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

 <?php echo $this->Form->error('name', null, array('wrap' => 'label', 'class' => 'error')); ?>
Sign up to request clarification or add additional context in comments.

Comments

1

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

1 Comment

that doesnt do the job. i need to have a label wrapper

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.