PHP头条
热点:

cakephp有关问题


cakephp问题
这个是我写的代码:

  class BooksController extends AppController
  {
   var $name='Books';
   var $help='form';
function index() { 
$this->Book->recursive = 1; 
$books = $this->Book->find('all',array('field'=>array('Book.isbn','Book.title','Author.name'))); 
$this->set('books', $books); 

function add()
{
   if(!empty($this->data))
   {
      $this->Book->create();
      $this->Book->save($this->data);
      $this->redirect(array('action'=>'index'));
   }
    $authors = $this->Book->Author->generateList();
      $this->set('$authors',$authors);
}

?>

然后出现这个问题

该怎样解决呢? 分享到:
------解决方案--------------------
估计是这句$authors = $this->Book->Author->generateList(); 有问题试试$authors = $this->Book->generateList(); 

www.phpzy.comtrue/phprm/8694.htmlTechArticlecakephp有关问题 cakephp问题 这个是我写的代码: classBooksControllerextendsAppController { var$name='Books'; var$help='form'; functionindex(){ $this->Book->recursive=1; $books=$this->Book->find('all',array('field'=>array('Book.i...

相关文章

相关频道:

PHP之友评论

今天推荐