模型创建正确,执行 crud AD backend/ads 提示如下错误。
exception 'CException' with message 'AD does not have a method named "behaviors".' in D:\xampp\htdocs\yii-1.1b.r1504\framework\base\CComponent.php:237
Stack trace:
#0 [internal function]: CComponent->__call('behaviors', Array)
#1 D:\xampp\htdocs\yii-1.1b.r1504\framework\db\ar\CActiveRecord.php(327): AD->behaviors()
#2 D:\xampp\htdocs\yii-1.1b.r1504\framework\cli\commands\shell\CrudCommand.php(191): CActiveRecord::model('Ad')
#3 D:\xampp\htdocs\yii-1.1b.r1504\framework\console\CConsoleCommand.php(116): CrudCommand->generateController('D:\xampp\htdocs...', Array)
#4 D:\xampp\htdocs\yii-1.1b.r1504\framework\cli\commands\shell\CrudCommand.php(177): CConsoleCommand->copyFiles(Array, 'D:\xampp\htdocs...', Array)
#5 D:\xampp\htdocs\yii-1.1b.r1504\framework\cli\commands\ShellCommand.php(142): CrudCommand->run(Array)
#6 D:\xampp\htdocs\yii-1.1b.r1504\framework\cli\commands\ShellCommand.php(99): ShellCommand->runShell(Array)
#7 D:\xampp\htdocs\yii-1.1b.r1504\framework\console\CConsoleCommandRunner.php(62): ShellCommand->run()
#8 D:\xampp\htdocs\yii-1.1b.r1504\framework\console\CConsoleApplication.php(88): CConsoleCommandRunner->run(Array)
#9 D:\xampp\htdocs\yii-1.1b.r1504\framework\base\CApplication.php(135): CConsoleApplication->processRequest(Array)
#10 D:\xampp\htdocs\yii-1.1b.r1504\framework\yiic.php(31): CApplication->run()
#11 D:\xampp\htdocs\niugu99\protected\yiic.php(7): require_once('D:\xampp\htdocs...')
#12 {main}
模型生成之后未做任何修改。