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
ff3506ae
Commit
ff3506ae
authored
Sep 01, 2014
by
Mark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed docs
parent
2410766f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
README.md
extensions/faker/README.md
+4
-11
No files found.
extensions/faker/README.md
View file @
ff3506ae
...
@@ -69,14 +69,11 @@ In this script, you can use the following two predefined variables:
...
@@ -69,14 +69,11 @@ In this script, you can use the following two predefined variables:
With such a template file, you can generate your fixtures using the commands like the following:
With such a template file, you can generate your fixtures using the commands like the following:
```
```
# generate fixtures for the users table based on users fixture template
# generate fixtures from user fixture template
php yii fixture/generate User
php yii fixture/generate user
# also a short version of this command ("generate" action is default)
php yii fixture User
# to generate several fixture data files
# to generate several fixture data files
php yii fixture
User Profile T
eam
php yii fixture
user profile t
eam
```
```
In the code above
`users`
is template name. After running this command, a new file with the same template name
In the code above
`users`
is template name. After running this command, a new file with the same template name
...
@@ -113,17 +110,13 @@ After you created custom provider, for example:
...
@@ -113,17 +110,13 @@ After you created custom provider, for example:
```
php
```
php
class
Book
extends
\Faker\Provider\Base
class
Book
extends
\Faker\Provider\Base
{
{
public
function
title
(
$nbWords
=
5
)
public
function
title
(
$nbWords
=
5
)
{
{
$sentence
=
$this
->
generator
->
sentence
(
$nbWords
);
$sentence
=
$this
->
generator
->
sentence
(
$nbWords
);
return
mb_substr
(
$sentence
,
0
,
mb_strlen
(
$sentence
)
-
1
);
return
mb_substr
(
$sentence
,
0
,
mb_strlen
(
$sentence
)
-
1
);
}
}
public
function
ISBN
()
{
return
$this
->
generator
->
randomNumber
(
13
);
}
}
}
```
```
...
...
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