Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Merge branch 'develop' of git://github.com/burzum/cakephp-user-tools …
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
Florian Krämer committed Jun 1, 2015
2 parents b9f1b66 + 5a61599 commit 4f2ce11
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions docs/Tutorials/Quick-Start.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,34 @@ Quick Start

If you database follows the schema the plugin expects to work with you can simply kick start your users in the application by just adding the component and helper.

In \App\Controller\UsersController:
In src\App\Controller\UsersController.php:

```php
namespace App\Controller;

use App\Controller\AppController;
use Cake\Event\Event;

UsersController extends AppController {
public function initialize() {
parent::initialize();
$this->loadComponent('Burzum/UserTools.UserTool');
);

// To use the helper you'll have to set the user data to the view!
public function beforeRender(Event $event) {
$this->set('userData', $this->Auth->user());
}
}
```

In your \App\View\AppView:
In src\App\View\AppView.php:

```php
namespace App\View;

use App\View\View;

class AppView extends View {
public function initialize() {
parent::initialize();
Expand All @@ -29,4 +43,4 @@ The component will take the main model of the controller and load the ```UserBeh

Go to ```/users/register``` and try to register, make sure your email config is set up properly.

You should receive an email notification with a token and a verification URL. After verifying your user go to ```/users/login``` and try to login.
You should receive an email notification with a token and a verification URL. After verifying your user go to ```/users/login``` and try to login.

0 comments on commit 4f2ce11

Please sign in to comment.