mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-11 15:16:55 +03:00
Add recipe for FOSUserBundle
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
fos_user:
|
||||
db_driver: orm
|
||||
firewall_name: main
|
||||
user_class: App\Entity\User
|
||||
from_email:
|
||||
address: "address"
|
||||
sender_name: "name"
|
||||
@@ -0,0 +1,18 @@
|
||||
fos_user_security:
|
||||
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
|
||||
|
||||
fos_user_profile:
|
||||
resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
|
||||
prefix: /profile
|
||||
|
||||
fos_user_register:
|
||||
resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
|
||||
prefix: /register
|
||||
|
||||
fos_user_resetting:
|
||||
resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
|
||||
prefix: /resetting
|
||||
|
||||
fos_user_change_password:
|
||||
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
|
||||
prefix: /profile
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"bundles": {
|
||||
"FOS\\UserBundle\\FOSUserBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<bg=blue;fg=white> </>
|
||||
<bg=blue;fg=white> What's next? </>
|
||||
<bg=blue;fg=white> </>
|
||||
|
||||
Warning: make sure the twig engine is turned on in framework.yaml
|
||||
|
||||
- If not, add the following to config/packages/framework.yaml:
|
||||
|
||||
framework:
|
||||
# ...
|
||||
csrf_protection: { enabled: true }
|
||||
templating:
|
||||
engines: ['twig']
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use FOS\UserBundle\Model\User as BaseUser;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="fos_user")
|
||||
*/
|
||||
class User extends BaseUser
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// your own logic
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user