maclechan
$this->registerJs( '$("document").ready(function(){ $("#login-form").validate({ errorElement : "small", errorClass : "error", rules: { "AgNav[nav_cn]": { required: true, }, }, messages:{ "AgNav[nav_cn]" : { required : "此字段不能为空.", }, } }); });' );
再补个写法
- maclechan 发布了教程yii2.0 小部件的高级使用
- maclechan 2015-05-21 已签到连续签到1天,获得了5个金钱
1.
$this->registerJsFile('@web/other/jquery.autocomplete.min.js',['depends'=>['yii\web\JqueryAsset'],'position'=>View::POS_HEAD])
2.$this->registerCssFile('@web/other/jquery.autocomplete.css');
3.
$this->registerJs($jsstring)
4.$this->registerCss($cssstring)
第三、四个,是要在AppAsset.php里面定义吗?