Permalink
Browse files

syntax highlight

  • Loading branch information...
1 parent b8e7fa3 commit 6d9768607b3cfd936887aac597214ebd1b1505e5 @c9s committed Sep 16, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 README.md
View
@@ -34,7 +34,6 @@ your messages.
The following sample code shows the format of message dictionary:
```php
-<?php
$validtor = new PasswordValidator(array( /* options */ ), array(
'require_digits_error' => 'Please enter digits in your password',
'require_alpha_error' => 'Please enter alphabets in your password',
@@ -53,21 +52,23 @@ validator class.
To return an invalid message in your validator:
- return $this->invalid('require_digits_error');
+```php
+return $this->invalid('require_digits_error');
+```
To return an valid message in your validator:
- return $this->valid('require_digits_error');
+```php
+return $this->valid('require_digits_error');
+```
To get the result messages from validator:
```php
-<?php
$msgs = $validator->getMessages();
foreach( $msgs as $msgId => $msg ) {
// $msg => ValidationMessage
}
-?>
```
The result message is a `ValidationMessage` object, there are three class

0 comments on commit 6d97686

Please sign in to comment.