Anax user module Readme
, (*1)
About
This is a user module for Anax. With this you can handle the users stored in your database. And validate a user and login the user., (*2)
You can also create new users, edit users and delete users., (*3)
Installation
This installation depends on a working db object loaded into DI. Which means you need to already have a configured database that is loaded into the DI-container., (*4)
You also need the session loaded into the DI-container., (*5)
With these dependencies taken care off you can continue by installing the module through composer by running the following command., (*6)
composer require ptorn/user
After the ptorn/user module is downloaded into your vendor-folder by running the command above we can start copying the needed files., (*7)
Router
The route file /vendor/ptorn/bth-anax-user/config/route/userController.php
needs to be copied into /config/route/
This way the new routes will be automaticly loaded with all the other routes., (*8)
DI
Now we need to add the module to the DI-container.
Copy /vendor/ptorn/bth-anax-user/config/di-user.php
into /config/di/
, (*9)
Database
Now we need a table in the database to store the users. In /config/sql/setup.sql
you will find the query needed to setup your database table. Don't forget to set your own database in the setup.sql
, (*10)
Views
The last step is to copy the views from /vendor/ptorn/user/bth-anax-user/view/user/
into /view/
, (*11)
Autoload Namespace
Add this to your composer.json
"autoload": {
"psr-4": {
"Peto16\\": "src/",
"testing\\": "test/src/"
}
, (*12)
Usage
Once installation is done there will be some new routes available.
/user/login
/user/logout
/user/create
/user/delete/{Id}
, (*13)
License
This software carries a MIT license., (*14)
.
..: Copyright (c) 2017 Peder Tornberg (peder.tornberg@gmail.com)