Skip to content

Instantly share code, notes, and snippets.

@ninjacn
Created September 7, 2015 14:39
Show Gist options
  • Select an option

  • Save ninjacn/a0e47f2bd767a988b861 to your computer and use it in GitHub Desktop.

Select an option

Save ninjacn/a0e47f2bd767a988b861 to your computer and use it in GitHub Desktop.

Revisions

  1. ninjacn created this gist Sep 7, 2015.
    10 changes: 10 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    class LoginForm extends CFormModel
    {
    public $username;
    public $password;
    }

    $form = new LoginForm();
    $form->validatorList->add(
    CValidator::createValidator('required', $form, 'username, password')
    );