Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... CMaskedTextField is a format input box. you can specify a Mask to restrict the text formats that users can access. for example, if 99.99.9999 is used, only text similar to a date can be input.
Modify the View and add the CMaskedTextField component.
Widget ('cmaskedtextfield', array ('model' => $ model, 'attribute' => 'date', 'name' => 'date ', 'mask' => '99. 99.9999 ', 'htmlopexception' => array ('style' => 'width: 80px;'),);?>
To work with CMaskedTextField, we modify DataModel to add a date attribute.
ClassDataModel extends CFormModel {public $ date; public function rules () {return array ('date', 'Safe '),);}}
The above is the content of the MaskedTextField sample UI component in the PHP development Framework Yii Framework tutorial (14). For more information, see PHP Chinese website (www.php1.cn )!