您当前的位置:首页 > 分类 > 技术资讯 > YII > 正文

有关Yii form 显示不出来 model找不到的问题

发布时间:2015-01-20 09:59:35      来源:51推一把
【摘要】按照Yii的文档建立一个form,: 1. create a model class repressenting the data fields to be collected.    2. create a controller action with code that responds to form submission.    3. ctrate a form in the view script
按照Yii的文档建立一个form,:

    1. create a model class repressenting the data fields to be collected.

    2. create a controller action with code that responds to form submission.

    3. ctrate a form in the view script file associated with the controller action.

总结了一下,form表单的3种用途:

      1、收集保存数据

      2、展示数据

      3、进行登录验证

建立form后,却发现页面不显示,并提示如图错误。然而,自己在view里面写的表单却可以显示。通过调试,确定是model没有找到。

由于全过程都是由gii生成,并没有考虑其路径问题。在加入Yii::import(application.models.wsdd.*);后,就可以找到model的路径了。