【发布时间】:2010-09-15 01:29:04
【问题描述】:
我目前正在努力通过IBM's tutorial on CakePHP
有一次我遇到了这个 sn-p 代码:
<?php
class Dealer extends AppModel {
var $name = 'Dealer';
var $hasMany = array (
'Product' => array(
'className' => 'Product',
'conditions'=>, // is this allowed?
'order'=>, // same thing here
'foreignKey'=>'dealer_id'
)
);
}
?>
当我运行它时,我收到以下错误消息:“第 7 行 /Applications/MAMP/htdocs/cakephp/app/models/product.php 中的解析错误:语法错误,意外 ','”
我是 PHP 的 n00b,所以我的问题是:是否允许使用没有赋值的键创建数组?有没有人玩过这个 tut 并且知道发生了什么?
【问题讨论】: