TestMemberValidation.php 638 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: 芸众商城 www.yunzshop.com
  5. * Date: 22/02/2017
  6. * Time: 18:48
  7. */
  8. namespace app\backend\modules\member\services;
  9. use app\common\extensions\Validation;
  10. class TestMemberValidation extends Validation
  11. {
  12. /**
  13. * Validate a comment before publishing it.
  14. *
  15. * @throws ValidateException
  16. * @return void
  17. */
  18. public function publish()
  19. {
  20. $this->rules = array(
  21. 'name' => array('required'),
  22. 'email' => array('required', 'email'),
  23. 'comment' => array('required', 'max:200')
  24. );
  25. $this->validate();
  26. }
  27. }