Heim  >  Artikel  >  Backend-Entwicklung  >  cakephp有关问题

cakephp有关问题

WBOY
WBOYOriginal
2016-06-13 12:40:57792Durchsuche

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 />
?>

然后出现这个问题

该怎样解决呢?

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn