Login with yii2

How can i login to yii2 advanced frontend with 2 table in same database, what i need to do first. I have no idea. Please help me thank you very much!

1 Like

you must have one user table but you can do to create two models and each one should be capable of inserting data into the same table in the database.

Start with the steps in: Getting Started: Installation | Yii 2 Advanced Project Template | Yii PHP Framework

Below are the steps I follow - perhaps one day I will write up detailed steps for each:

  • Install Composer
  • Run Composer to Install Yii2 Advanced Template
  • Initialize Install by running ./init
  • Complete Apache/Web Server Configuration
  • Complete Database Configuration by updating common/config/main-local.php
  • Run Migrate by running ./yii migrate
  • Mail Configuration by updaring common/config/main-local.php
    • Configure FROM email addresses
  • Optinally: Composer Configuration for additional widgets
  • Update Application Id and Name in frontend/config/main.php
  • Use Formatter configuration to set timezone in frontend/config/main.php
  • URL Configuration for pretty URLs in frontend/config/main.php
  • Gii configuration in frontend/config/main-local.php to include allowedIPs
  • Debug configuration in frontend/config/main-local.php to include allowedIPs
  • Use the application to register a new user and login using the registration email

Also found this tutorial that may help you out with some of the steps above: