PHP Development Framework Yii Framework Tutorial (Maskedtextfield) UI component sample

Source: Internet
Author: User
Cmaskedtextfield is a format input box that allows you to specify a mask that restricts the text format that the user can access, as in this case, you can only allow text that is similar to date to be entered by using 99.99.9999.

Modify view, add Cmaskedtextfield component

Widget (' Cmaskedtextfield ', Array (' model ' = = $model, ' attribute ' = ' date ', ' name ' = ' Date ', ' mask ' = ' 99.99.9999 ', ' htmloptions ' =>array (' style ' = ' width:80px; '),);? >

In order to work with Cmaskedtextfield, we modify Datamodel to add a property date

Classdatamodel extends cformmodel{public $date;p ublic function rules () {return Array (array (' Date ', ' safe '),}}

The above is the content of the PHP Development Framework Yii Framework Tutorial (Maskedtextfield) UI component sample, more about topic.alibabacloud.com (www.php.cn)!

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