Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
18524631
Commit
18524631
authored
Sep 01, 2014
by
Mark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed docs
parent
b8ce6ff6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
11 deletions
+27
-11
FixtureController.php
extensions/faker/FixtureController.php
+17
-11
README.md
extensions/faker/README.md
+10
-0
No files found.
extensions/faker/FixtureController.php
View file @
18524631
...
@@ -55,10 +55,10 @@ use yii\helpers\VarDumper;
...
@@ -55,10 +55,10 @@ use yii\helpers\VarDumper;
* After you prepared needed templates for tables you can simply generate your fixtures via command
* After you prepared needed templates for tables you can simply generate your fixtures via command
*
*
* ~~~
* ~~~
* yii fixture/generate user
s
* yii fixture/generate user
*
*
* //generate fixtures from several templates, for example:
* //generate fixtures from several templates, for example:
* yii fixture user
s profile
* yii fixture user
profile team
* ~~~
* ~~~
*
*
* In the code above "users" is template name, after this command run, new file named same as template
* In the code above "users" is template name, after this command run, new file named same as template
...
@@ -83,7 +83,7 @@ use yii\helpers\VarDumper;
...
@@ -83,7 +83,7 @@ use yii\helpers\VarDumper;
*
*
* ~~~
* ~~~
* //generate fixtures in russian language
* //generate fixtures in russian language
* yii fixture/generate user
s
--count=5 --language=ru_RU
* yii fixture/generate user --count=5 --language=ru_RU
*
*
* //read templates from the other path
* //read templates from the other path
* yii fixture/generate-all --templatePath=@app/path/to/my/custom/templates
* yii fixture/generate-all --templatePath=@app/path/to/my/custom/templates
...
@@ -92,6 +92,16 @@ use yii\helpers\VarDumper;
...
@@ -92,6 +92,16 @@ use yii\helpers\VarDumper;
* yii fixture/generate-all --fixtureDataPath=@tests/unit/fixtures/subfolder1/subfolder2/subfolder3
* yii fixture/generate-all --fixtureDataPath=@tests/unit/fixtures/subfolder1/subfolder2/subfolder3
* ~~~
* ~~~
*
*
* You can see all available templates by running command:
*
* ~~~
* //list all templates under default template path (i.e. '@tests/unit/templates/fixtures')
* yii fixture/templates
*
* //list all templates under specified template path
* yii fixture/templates --templatePath='@app/path/to/my/custom/templates'
* ~~~
*
* You also can create your own data providers for custom tables fields, see Faker library guide for more info (https://github.com/fzaninotto/Faker);
* You also can create your own data providers for custom tables fields, see Faker library guide for more info (https://github.com/fzaninotto/Faker);
* After you created custom provider, for example:
* After you created custom provider, for example:
*
*
...
@@ -179,7 +189,7 @@ class FixtureController extends \yii\console\controllers\FixtureController
...
@@ -179,7 +189,7 @@ class FixtureController extends \yii\console\controllers\FixtureController
/**
/**
* Lists all available fixtures template files.
* Lists all available fixtures template files.
*/
*/
public
function
action
All
Templates
()
public
function
actionTemplates
()
{
{
$foundTemplates
=
$this
->
findTemplatesFiles
();
$foundTemplates
=
$this
->
findTemplatesFiles
();
...
@@ -195,15 +205,11 @@ class FixtureController extends \yii\console\controllers\FixtureController
...
@@ -195,15 +205,11 @@ class FixtureController extends \yii\console\controllers\FixtureController
* For example,
* For example,
*
*
* ~~~
* ~~~
* ~~~
* //generate fixtures in russian language
* //generate fixtures in russian language
* yii fixture/generate users --count=5 --language=ru_RU
* yii fixture/generate user --count=5 --language=ru_RU
*
* //read templates from the other path and generate all fixtures
* yii fixture/generate-all --templatePath=@app/path/to/my/custom/templates
*
*
* //generate
all fixtures into other folder
s
* //generate
several fixture
s
* yii fixture/generate
-all --fixtureDataPath=@tests/unit/fixtures/subfolder1/subfolder2/subfolder3
* yii fixture/generate
user profile team
* ~~~
* ~~~
*
*
* @throws \yii\base\InvalidParamException
* @throws \yii\base\InvalidParamException
...
...
extensions/faker/README.md
View file @
18524631
...
@@ -104,6 +104,16 @@ php yii fixture/generate-all --templatePath='@app/path/to/my/custom/templates'
...
@@ -104,6 +104,16 @@ php yii fixture/generate-all --templatePath='@app/path/to/my/custom/templates'
php yii fixture/generate-all --fixtureDataPath='@tests/acceptance/fixtures/data'
php yii fixture/generate-all --fixtureDataPath='@tests/acceptance/fixtures/data'
```
```
You can see all available templates by running command:
```
# list all templates under default template path (i.e. '@tests/unit/templates/fixtures')
php yii fixture/templates
# list all templates under specified template path
php yii fixture/templates --templatePath='@app/path/to/my/custom/templates'
```
You also can create your own data providers for custom tables fields, see
[
Faker
](
https://github.com/fzaninotto/Faker
)
library guide for more info;
You also can create your own data providers for custom tables fields, see
[
Faker
](
https://github.com/fzaninotto/Faker
)
library guide for more info;
After you created custom provider, for example:
After you created custom provider, for example:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment