Skip to content

Instantly share code, notes, and snippets.

@eghojansu
Created September 11, 2017 09:59
Show Gist options
  • Save eghojansu/7d1ec28c5c1c63c816925a17cde98536 to your computer and use it in GitHub Desktop.
Save eghojansu/7d1ec28c5c1c63c816925a17cde98536 to your computer and use it in GitHub Desktop.
Snippet for post Install nelmio/alice di Framework Symfony
# src/AppBundle/DataFixtures/ORM/fixtures/admin.yml
AppBundle\Entity\Admin:
admin{1..2}:
name: '<firstName()> <lastName()>'
gender: '<myGender()>'
birthplace: '<city()>'
birthdate: '<dateTime()>'
user: '@userAdmin<current()>'
# src/AppBundle/DataFixtures/ORM/fixtures/operator.yml
AppBundle\Entity\Operator:
operator{1..2}:
nama: '<firstName()> <lastName()>'
jenisKelamin: '<myGender()>'
tempatLahir: '<city()>'
tanggalLahir: '<dateTime()>'
nomorHp: '<phoneNumber()>'
user: '@userOperator<current()>'
# src/AppBundle/DataFixtures/ORM/fixtures/user.yml
parameters:
myPassword: 'welcome'
AppBundle\Entity\User:
userAdmin{1..2}:
username: 'admin<current()>'
password: '<myPassword(@self, "<{myPassword}>")>'
active: 1,
roles:
- 'ROLE_ADMIN'
userOperator{1..2}:
username: 'operator<current()>'
password: '<myPassword(@self, "<{myPassword}>")>'
active: 1,
roles:
- 'ROLE_OPERATOR'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment