Syntax cakephp错误:意外';(';,期望';)';,我的语法错了吗?
你看到这里有语法错误吗Syntax cakephp错误:意外';(';,期望';)';,我的语法错了吗?,syntax,cakephp-2.0,Syntax,Cakephp 2.0,你看到这里有语法错误吗 'Coupon'=>array( 'fields'=>array( 'promo_code','desc' ), 'conditions'=>array( 'OR'=>array( 'expires' =>0,
'Coupon'=>array(
'fields'=>array(
'promo_code','desc'
),
'conditions'=>array(
'OR'=>array(
'expires' =>0,
'Coupon.end_date >'=>date('Y-m-d')
)
)
),
这是控制器代码中“包含”数组的一部分。当我从代码中删除这段代码时,cake非常有用(只有我需要这部分!)。我在下面发布了完整的声明。帮忙
public $paginate = array(
'Location'=>array(
'joins' => array(
array(
'table' => 'locations_tags',
'alias' => 'LocationsTag',
'type' => 'inner',
'conditions'=> array(
'LocationsTag.location_id = Location.id'
)
)
),
'limit'=>9,
'contain'=>array(
'Course'=>array(
'fields'=>array(
'specials', 'contact','desc'
),
'conditions'=>array('Course.active'=>1)
),
'Charter'=>array(
'fields'=>array(
'book','specials', 'contact','desc'
),
'conditions'=>array('Charter.active'=>1)
),
'Restaurant'=>array(
'fields'=>array(
'menu','wine_list','specials', 'contact','desc'
),
'conditions'=>array('Restaurant.active'=>1)
),
'Nightclub'=>array(
'fields'=>array(
'menu','schedule','specials', 'contact','desc'
),
'conditions'=>array('Nightclub.active'=>1)
),
'Store'=>array(
'fields'=>array(
'catalog','specials', 'contact','desc'
),
'conditions'=>array('Store.active'=>1)
),
'Coupon'=>array(
'fields'=>array(
'promo_code','desc'
),
'conditions'=>array(
'OR'=>array(
'expires' =>0,
'Coupon.end_date >'=>date('Y-m-d')
)
)
),
'Image',
'Tag'=>array(
'fields'=>array(
'seo_tag'
)
)
)
)
);
不能在类属性声明中指定计算值(例如,调用函数)。它们必须是常量
对于计算值,您必须在构造函数或其他内容中分配该值
发件人:
该声明可能包含一个初始化,但该初始化必须是一个常量值——也就是说,它必须能够在编译时进行计算,并且必须不依赖于运行时信息才能进行计算
'Coupon.end_date >'=>date('Y-m-d')