Skip to content

Commit

Permalink
Updated/Fixed README
Browse files Browse the repository at this point in the history
  • Loading branch information
h.woltersdorf committed Aug 20, 2016
1 parent 586e79b commit 2727d0f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ $form->renewToken( new MyToken() );

# Check if CSRF token is valid (boolean)
# Checks token string and expiry
$token = new Token::fromString( $_POST['token'] );
$token = Token::fromString( $_POST['token'] );
$form->isTokenValid( $token );

# Check if CSRF token is valid (throws exceptions)
# Checks token string and expiry
# Throws \IceHawk\Forms\Excpetion\TokenMismatch, if token string does not match
# Throws \IceHawk\Forms\Excpetion\TokenHasExpired, if token has expired
$token = new Token::fromString( $_POST['token'] );
$token = Token::fromString( $_POST['token'] );
$form->guardTokenIsValid( $token );

# Check if token is expired
Expand Down Expand Up @@ -174,7 +174,10 @@ $form->addFeedbacks(
# Feedback implementation must follow the \IceHawk\Forms\Interfaces\ProvidesFeedback interface
$form->addFeedback( 'firstname', new MyFeedback( 'Firstname is invalid.' ) );

# Check for feedback
# Check for feedbacks
$form->hasFeedbacks(); # true

# Check for single feedback
if ( $form->hasFeedback( 'username' ) )
{
# Retrieve single feedback
Expand Down

0 comments on commit 2727d0f

Please sign in to comment.