PHP code example of steevanb / user-bundle

1. Go to this page and download the library: Download steevanb/user-bundle 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/ */

    

steevanb / user-bundle example snippets


# config/bundles.php
return [
    Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
    steevanb\\UserBundle\UserBundle::class => ['all' => true]
]

# src/Entity/User.php

namespace App\Entity;

use steevanb\UserBundle\Entity\AbstractUser;

class User extends AbstractUser
{
}


# src/Controller/SecurityController.php
class SecurityController extends steevanb\UserBundle\Controller\AbstractSecurityController
{
    protected function createUser(): AbstractUser
    {
        # Create your User entity
        return new User();
    }

    protected function createRegisterForm(): FormInterface
    {
        return new RegisterType();
    }

    protected function createRegisteredResponse(): Response
    {
        return new Response('User registered.');
    }
}

# src/Form/Type/RegisterType.php

namespace App\Form\Type;

use steevanb\UserBundle\Form\Type\AbstractRegisterType;

class RegisterType extends AbstractRegisterType
{
}