PHP code example of originphp / user_authentication

1. Go to this page and download the library: Download originphp/user_authentication library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

originphp / user_authentication example snippets


class AppController extends Controller
{
    protected function initialize() : void
    {
        $this->loadComponent('Auth', [
            'loginAction' => '/login',
            'loginRedirect' => '/profile', # Set this to something valid
            'logoutRedirect' => '/login',
            'model' => 'UserAuthentication.User'
        ]);
    }
}

Config::write('App.name','Web Application');