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
d1e0a545
Commit
d1e0a545
authored
Jun 04, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
guide WIP [skip ci]
parent
1ea6e76e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
README.md
docs/guide/README.md
+4
-4
input-validation.md
docs/guide/input-validation.md
+0
-0
structure-models.md
docs/guide/structure-models.md
+1
-1
DynamicModel.php
framework/base/DynamicModel.php
+1
-1
CompareValidator.php
framework/validators/CompareValidator.php
+9
-9
No files found.
docs/guide/README.md
View file @
d1e0a545
...
@@ -35,8 +35,8 @@ Application Structure
...
@@ -35,8 +35,8 @@ Application Structure
*
[
Applications
](
structure-applications.md
)
*
[
Applications
](
structure-applications.md
)
*
[
Application Components
](
structure-application-components.md
)
*
[
Application Components
](
structure-application-components.md
)
*
[
Controllers
](
structure-controllers.md
)
*
[
Controllers
](
structure-controllers.md
)
*
[
Views
](
structure-views.md
)
*
[
Models
](
structure-models.md
)
*
[
Models
](
structure-models.md
)
*
[
Views
](
structure-views.md
)
*
**TBD**
[
Filters
](
structure-filters.md
)
*
**TBD**
[
Filters
](
structure-filters.md
)
*
**TBD**
[
Widgets
](
structure-widgets.md
)
*
**TBD**
[
Widgets
](
structure-widgets.md
)
*
**TBD**
[
Modules
](
structure-modules.md
)
*
**TBD**
[
Modules
](
structure-modules.md
)
...
@@ -88,9 +88,9 @@ Getting Data from Users
...
@@ -88,9 +88,9 @@ Getting Data from Users
-----------------------
-----------------------
*
[
Creating Forms
](
input-forms.md
)
*
[
Creating Forms
](
input-forms.md
)
*
[
Input Validation
](
input-validation.md
)
*
[
Validating Input
](
input-validation.md
)
*
**TBD**
[
Uploading Files
](
input-file-upload
ing
.md
)
*
**TBD**
[
Uploading Files
](
input-file-upload.md
)
*
**TBD**
[
Inputs
for Multiple Models
](
input-multiple-models.md
)
*
**TBD**
[
Getting Data
for Multiple Models
](
input-multiple-models.md
)
Displaying Data
Displaying Data
...
...
docs/guide/input-validation.md
View file @
d1e0a545
This diff is collapsed.
Click to expand it.
docs/guide/structure-models.md
View file @
d1e0a545
...
@@ -218,7 +218,7 @@ should be displayed to help the user to fix the errors.
...
@@ -218,7 +218,7 @@ should be displayed to help the user to fix the errors.
You may call
[
[yii\base\Model::validate()
]
] to trigger validation. The method will go through every
*active rule*
You may call
[
[yii\base\Model::validate()
]
] to trigger validation. The method will go through every
*active rule*
and make sure it is satisfied. If not, an error message will be generated for each failed rule and attribute.
and make sure it is satisfied. If not, an error message will be generated for each failed rule and attribute.
The method returns a boolean value indicating whether all rules are satisfied. If not, you may retrieve the
The method returns a boolean value indicating whether all rules are satisfied. If not, you may retrieve the
error messages through the property
[
[yii\base\Model::errors
]
]. For example,
error messages through the property
[
[yii\base\Model::errors
]
]
or
[
[yii\base\Model::firstErrors
]
]
. For example,
```
php
```
php
$model
=
new
\app\models\ContactForm
;
$model
=
new
\app\models\ContactForm
;
...
...
framework/base/DynamicModel.php
View file @
d1e0a545
...
@@ -10,7 +10,7 @@ namespace yii\base;
...
@@ -10,7 +10,7 @@ namespace yii\base;
use
yii\validators\Validator
;
use
yii\validators\Validator
;
/**
/**
* DynamicModel is a model class primarily used to support ad
-
hoc data validation.
* DynamicModel is a model class primarily used to support ad
hoc data validation.
*
*
* The typical usage of DynamicModel is as follows,
* The typical usage of DynamicModel is as follows,
*
*
...
...
framework/validators/CompareValidator.php
View file @
d1e0a545
...
@@ -12,7 +12,7 @@ use yii\base\InvalidConfigException;
...
@@ -12,7 +12,7 @@ use yii\base\InvalidConfigException;
use
yii\helpers\Html
;
use
yii\helpers\Html
;
/**
/**
* CompareValidator compares the specified attribute value with another value
and validates if they are equal
.
* CompareValidator compares the specified attribute value with another value.
*
*
* The value being compared with can be another attribute value
* The value being compared with can be another attribute value
* (specified via [[compareAttribute]]) or a constant (specified via
* (specified via [[compareAttribute]]) or a constant (specified via
...
@@ -47,14 +47,14 @@ class CompareValidator extends Validator
...
@@ -47,14 +47,14 @@ class CompareValidator extends Validator
/**
/**
* @var string the operator for comparison. The following operators are supported:
* @var string the operator for comparison. The following operators are supported:
*
*
* -
'==': validates to see if the
two values are equal. The comparison is done is non-strict mode.
* -
`==`: check if
two values are equal. The comparison is done is non-strict mode.
* -
'===': validates to see if the
two values are equal. The comparison is done is strict mode.
* -
`===`: check if
two values are equal. The comparison is done is strict mode.
* -
'!=': validates to see if the
two values are NOT equal. The comparison is done is non-strict mode.
* -
`!=`: check if
two values are NOT equal. The comparison is done is non-strict mode.
* -
'!==': validates to see if the
two values are NOT equal. The comparison is done is strict mode.
* -
`!==`: check if
two values are NOT equal. The comparison is done is strict mode.
* - `>`:
validates to see if the
value being validated is greater than the value being compared with.
* - `>`:
check if
value being validated is greater than the value being compared with.
* - `>=`:
validates to see if the
value being validated is greater than or equal to the value being compared with.
* - `>=`:
check if
value being validated is greater than or equal to the value being compared with.
* - `<`:
validates to see if the
value being validated is less than the value being compared with.
* - `<`:
check if
value being validated is less than the value being compared with.
* - `<=`:
validates to see if the
value being validated is less than or equal to the value being compared with.
* - `<=`:
check if
value being validated is less than or equal to the value being compared with.
*/
*/
public
$operator
=
'=='
;
public
$operator
=
'=='
;
/**
/**
...
...
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