Example #1
0
                <?php 
include_once "engine/templates/header.php";
?>
            </div>
            
    		<div id="content">
                    <form method="post" class="login">
                        <h1>Connexion</h1>
                        <input type="hidden" name="a" value="a3">

                        <input class="input-large" type="text" name="u" placeholder="Pseudo" value="<?php 
echo $form->getValue("u");
?>
" /> 
                                  <?php 
if (@$form->getError("u") != null) {
    echo '<br><span class="input-error">' . $form->getError("u") . "</span>";
}
?>
<br>
                        <input class="input-large" type="password" placeholder="Mot de passe" name="p" value="<?php 
echo $form->getValue("p");
?>
" />
                                  <?php 
if (@$form->getError("p") != null) {
    echo '<br><span class="input-error">' . $form->getError("p") . "</span>";
}
?>
<br>
Example #2
0
 /**
  * @covers Form::setErrorCode
  */
 public function testSetErrorCode()
 {
     $this->myForm->addError('fail');
     $this->myForm->setErrorCode('fail', 'This field is required');
     $this->assertEquals('This field is required', $this->myForm->getError(0));
 }