Fixes on PasswordForm

This commit is contained in:
Antonio de la Rosa 2015-08-26 00:32:20 +02:00
parent 528d5a2d48
commit 7dbe80697e
7 changed files with 76 additions and 18 deletions

View file

@ -3,6 +3,7 @@
namespace PhangoApp\PhaModels\Forms;
use PhangoApp\PhaModels\CoreFields\CharField;
use PhangoApp\PhaI18n\I18n;
/**
* Basic class for create forms
@ -16,6 +17,8 @@ class BaseForm {
* @param string $name Field class instance used for check files
*/
public $std_error='';
public function __construct($name, $value)
{
$this->label=$name;
@ -25,6 +28,7 @@ class BaseForm {
$this->type='text';
$this->required=0;
$this->field=new CharField();
$this->txt_error = I18n::lang('common', 'error_in_field', 'Error in field');
}
public function form()

View file

@ -0,0 +1,32 @@
<?php
namespace PhangoApp\PhaModels\Forms;
use PhangoApp\PhaModels\Forms\BaseForm;
use PhangoApp\PhaModels\CoreFields\PasswordField;
/**
* Basic class for create forms
*/
class PasswordForm extends BaseForm{
public function __construct($name, $value='')
{
parent::__construct($name, $value);
$this->field=new PasswordField();
}
public function form()
{
return '<input type="password" class="'.$this->css.'" name="'.$this->name.'" value="">';
}
}
?>