Home > Backend Development > PHP Tutorial > cakephp有关问题

cakephp有关问题

WBOY
Release: 2016-06-13 11:30:47
Original
893 people have browsed it

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

<?php <br />  class BooksController extends AppController<br />  {<br />  	var $name='Books';<br />  	var $help='form';<br />function index() { <br />$this->Book->recursive = 1; <br />$books = $this->Book->find('all',array('field'=>array('Book.isbn','Book.title','Author.name'))); <br />$this->set('books', $books); <br />} <br />function add()<br />{<br />   if(!empty($this->data))<br />   {<br />      $this->Book->create();<br />      $this->Book->save($this->data);<br />      $this->redirect(array('action'=>'index'));<br />   }<br />    $authors = $this->Book->Author->generateList();<br />      $this->set('$authors',$authors);<br />}<br />} 		<br />?>
Copy after login

然后出现这个问题

该怎样解决呢?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template