BaseProfileForm::__construct PHP Method

__construct() public method

Constructor.
public __construct ( $template, $user )
$template string
$user PKPUser
    function __construct($template, $user)
    {
        parent::__construct($template);
        $this->_user = $user;
        assert(isset($user));
        $this->addCheck(new FormValidatorPost($this));
        $this->addCheck(new FormValidatorCSRF($this));
    }

Usage Example

 /**
  * Constructor.
  * @param $user PKPUser
  */
 function __construct($user)
 {
     parent::__construct('user/contactForm.tpl', $user);
     // Validation checks for this form
     $this->addCheck(new FormValidator($this, 'country', 'required', 'user.profile.form.countryRequired'));
     $this->addCheck(new FormValidatorCustom($this, 'email', 'required', 'user.register.form.emailExists', array(DAORegistry::getDAO('UserDAO'), 'userExistsByEmail'), array($user->getId(), true), true));
 }
All Usage Examples Of BaseProfileForm::__construct