Because to be a mobile app client, if Yii relies on JavaScript to verify (such as whether the user name is empty AH), then the Android client will not work. Of course some people say directly on the Android client to verify it. In fact, it is true, I feel at the server to do more than verify that I am relieved.
For advice
Reply content:
Because to be a mobile app client, if Yii relies on JavaScript to verify (such as whether the user name is empty AH), then the Android client will not work. Of course some people say directly on the Android client to verify it. In fact, it is true, I feel at the server to do more than verify that I am relieved.
For advice
With his cactiveform components can be set at the same time to verify the front and back, but also to achieve such as validation failed to return to the page, the submitted data will remain in the form of the effect, specifically, please poke Cactiveform
The master should understand the following Yii
mechanism in detail Rule
.
Yii
Each Model
need to be set rule
, and this rule
rule plays a role in validating the data when it is saved or updated.
First, the master should read the manual, understand rule
the detailed rules, secondly, the following link describes some basic types, you can refer to:
"The rules validation specification in Yii CModel"
Both the front and back end are validated and rules can be specified.