Yii2 - Lesson -25 Assigning User Permissions with a checkboxlist

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 22

  • @nummydubstepkutt
    @nummydubstepkutt 9 років тому

    Good lesson. Its also good to see you make mistakes and see who you debug them.

  • @Thani1000
    @Thani1000 9 років тому +3

    Super lesson.

  • @TheWedostudio
    @TheWedostudio 9 років тому +2

    Hi, How this will be handled in update? I am not able to load the inserted selection. can you please help me on this.

  • @explorium6924
    @explorium6924 9 років тому +1

    How do i get a checkbox value inside signup model? I mean when it is not a checkboxlist, but a single check box... Only via $_POST array, or are there other methods?

  • @FutureSmartAI
    @FutureSmartAI 9 років тому +1

    Great job dude

  • @path617
    @path617 9 років тому +1

    thanks for great tutorial

  • @speak-easy-stories
    @speak-easy-stories 7 років тому

    instead of
    $_POST['SignupForm']['permissions'];
    we can have this one:
    $permission_lists = $this->permissions;
    since we already loaded the permission lists in the controller using the load() function .

  • @ibrahimhalouane8130
    @ibrahimhalouane8130 7 років тому

    I guess it's better to access post variable using yii::$app->request->post() instead of accessing $_POST directly.

  • @fehmibensaid5684
    @fehmibensaid5684 6 років тому

    Hi thank you very much realy i appriciate your effort really thanks a lot! just one question please how can i appair just the authitemchild because i think it is better imagine you have million object and every object have 4 permessions it is will be complexed .For example we can make 3 kind of user : sample user , admin, member and each one have it s authitems and will be appear just the authchild etc...

  • @Lightwin75
    @Lightwin75 9 років тому

    I love u man you are the best

  • @cfpmx
    @cfpmx 8 років тому

    I tried the checkboxList in other form but the checklist is not in a list format, I mean, they appear together one next to the other one. What I need to do for having them in a list format? Thanks in advance :)

  • @kamilonowski9816
    @kamilonowski9816 5 років тому

    i'm not sure but you should use createRole(), createPermission() methods with add() method, when update you should revoke previous permission and assign a new one as offical docs says ????

  • @Blonder413PaginaOficial
    @Blonder413PaginaOficial 7 років тому

    You should use the transactions :D

  • @MavisFT
    @MavisFT 5 років тому

    how to do this to a form that's generated from gii generator?
    it has different structure from the sign up form, can't work if i just do the same

  • @overdose4576
    @overdose4576 9 років тому

    for update operation the selected checkboxes r not showing selected

  • @hananfy6270
    @hananfy6270 7 років тому

    Undefined variable: authItems
    i had try a view time but i always get that error message. can you give me any solution? thanks

    • @gshxhvxhsgkhan1873
      @gshxhvxhsgkhan1873 6 років тому

      use this function in your SiteController
      public function actionSignup()
      {
      $model = new SignupForm();
      $authItems=AuthItem::find()->all();
      if ($model->load(Yii::$app->request->post())) {
      if ($user = $model->signup()) {
      if (Yii::$app->getUser()->login($user)) {
      return $this->goHome();
      }
      }
      }
      return $this->render('signup', [
      'model' => $model,
      'authItems'=>$authItems,
      ]);
      }
      after that ...
      include this code in your signup.php

  • @sergeyvaserman2512
    @sergeyvaserman2512 9 років тому

    Hello, Can you create lesson for i18n?, thanks)

  • @vladyslavstartsev9621
    @vladyslavstartsev9621 8 років тому +1

    Please use singular form of words when naming tables in DB, not plural. Users(incorrect)->User(correct).

  • @vladyslavstartsev9621
    @vladyslavstartsev9621 8 років тому

    Also, can you cut off those parts of video when you're getting errors and can't find out what to do.

    • @sistemasdecasa9459
      @sistemasdecasa9459 7 років тому

      I guess that the best thing would be if he leaves the part of the errors but tells you when he manage to resolved them.