我目前春耕我的方式,通过IBM's tutorial on CakePHP我可以在类变量中添加没有赋值的PHP数组键吗?
有一次,我碰到这个代码片段:
<?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,所以我的问题是:是否允许创建一个数组没有赋值的键?有没有人玩过这个啧啧,知道什么是?