is the form validation in the YII framework validated by JavaScript or by using PHP itself?

Source: Internet
Author: User
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 .

YiiEach 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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.