Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown scenario: default #20

Closed
jomonkj opened this issue Mar 26, 2015 · 2 comments
Closed

Unknown scenario: default #20

jomonkj opened this issue Mar 26, 2015 · 2 comments

Comments

@jomonkj
Copy link

jomonkj commented Mar 26, 2015

after configured. i got error
Unknown scenario: default.

I solved this using yiisoft/yii2#655

But can't log into backend after entering correct username and password.
again showing login page.

@izemize
Copy link

izemize commented Sep 7, 2015

hy. you overwrite scenario method in model. But, you need extend scenario. so..

wrong:

public function scenarios()
    {
        return [
              self::SCENARIO_JOIN=>['email','name','username','birthdate','gender','password','passagain']
        ];
    }

Good:

    const SCENARIO_JOIN = 'Join';

    public function scenarios()
    {
        $scenarios = parent::scenarios();
        $scenarios[self::SCENARIO_JOIN] = ['email','name','username','birthdate','gender','password','passagain'];
        return $scenarios;
    }

    public function rules()
    {
        return [
            [['email','name','username','birthdate','gender','password','passagain'],'required','on'=>self::SCENARIO_JOIN],

Please fix somebody the guide: http://www.yiiframework.com/doc-2.0/guide-structure-models.html

@kartik-v
Copy link
Member

Module has been updated to an initial usable release (though not tested fully)... Check #21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants