Api 在CakePHP项目中使用Constant Contact PHP包装器的正确方法是什么
我正在扩展一个现有的CakePHP项目,以利用Constant Contact API和php包装文件: 我已经下载了CTWrapper,并将其放在app/vendors文件夹中,并将其保存为“ctctWrapper.php”,以便Cake自动查找具有以下实现的文件: contacts\u controller.phpApi 在CakePHP项目中使用Constant Contact PHP包装器的正确方法是什么,api,cakephp,constants,contact,vendors,Api,Cakephp,Constants,Contact,Vendors,我正在扩展一个现有的CakePHP项目,以利用Constant Contact API和php包装文件: 我已经下载了CTWrapper,并将其放在app/vendors文件夹中,并将其保存为“ctctWrapper.php”,以便Cake自动查找具有以下实现的文件: contacts\u controller.php <?php App::import('Vendor', 'ctctwrapper'); class ContactsController extends AppContr
<?php
App::import('Vendor', 'ctctwrapper');
class ContactsController extends AppController {
var $name = 'Contacts';
var $uses = array('Contact', 'Group', 'MarketingList');
//Set pagination defaults
var $paginate = array(
'limit' => 25,
'order' => array(
'Contact.lastname' => 'asc'
)
);
function send(){
//do stuff here
}
}
?>
看起来大多数错误只是低级警告,即参数不存在。这些相对无害。例外情况是靠近末尾的以下几行
Notice (8): Undefined property: Contact::$table [CORE/cake/libs/model/model.php, line 666]
Notice (8): Undefined property: Contact::$table [CORE/cake/libs/model/model.php, line 707]
Notice (8): Undefined property: Contact::$table [CORE/cake/libs/model/model.php, line 698]
我敢打赌,这些错误是实际问题发生的地方,与常量Contact API类没有多大关系
由于我们无法看到您的
send()
函数中发生了什么,因此几乎不可能对其进行进一步调试。感谢您的关注。到目前为止,send函数确实是空的,它的存在只是为了不抛出“缺少控制器函数”错误。删除视图中的html帮助程序调用会杀死那些未定义的属性警告-这很有意义b/c联系人表中没有名为“foldername”的字段。Iirc,未定义的索引警告可以被抑制而没有问题吗?
Notice (8): Undefined index: status [CORE/vendors/ctctwrapper.php, line 1235]
Notice (8): Undefined index: link [CORE/vendors/ctctwrapper.php, line 1239]
Notice (8): Undefined index: email_address [CORE/vendors/ctctwrapper.php, line 1241]
Notice (8): Undefined index: first_name [CORE/vendors/ctctwrapper.php, line 1242]
Notice (8): Undefined index: middle_name [CORE/vendors/ctctwrapper.php, line 1243]
Notice (8): Undefined index: last_name [CORE/vendors/ctctwrapper.php, line 1244]
Notice (8): Undefined index: company_name [CORE/vendors/ctctwrapper.php, line 1245]
Notice (8): Undefined index: job_title [CORE/vendors/ctctwrapper.php, line 1246]
Notice (8): Undefined index: home_number [CORE/vendors/ctctwrapper.php, line 1247]
Notice (8): Undefined index: work_number [CORE/vendors/ctctwrapper.php, line 1248]
Notice (8): Undefined index: address_line_1 [CORE/vendors/ctctwrapper.php, line 1249]
Notice (8): Undefined index: address_line_2 [CORE/vendors/ctctwrapper.php, line 1250]
Notice (8): Undefined index: address_line_3 [CORE/vendors/ctctwrapper.php, line 1251]
Notice (8): Undefined index: city_name [CORE/vendors/ctctwrapper.php, line 1252]
Notice (8): Undefined index: state_code [CORE/vendors/ctctwrapper.php, line 1253]
Notice (8): Undefined index: state_name [CORE/vendors/ctctwrapper.php, line 1254]
Notice (8): Undefined index: country_code [CORE/vendors/ctctwrapper.php, line 1255]
Notice (8): Undefined index: zip_code [CORE/vendors/ctctwrapper.php, line 1256]
Notice (8): Undefined index: sub_zip_code [CORE/vendors/ctctwrapper.php, line 1257]
Notice (8): Undefined index: notes [CORE/vendors/ctctwrapper.php, line 1258]
Notice (8): Undefined index: custom_field_1 [CORE/vendors/ctctwrapper.php, line 1259]
Notice (8): Undefined index: custom_field_2 [CORE/vendors/ctctwrapper.php, line 1260]
Notice (8): Undefined index: custom_field_3 [CORE/vendors/ctctwrapper.php, line 1261]
Notice (8): Undefined index: custom_field_4 [CORE/vendors/ctctwrapper.php, line 1262]
Notice (8): Undefined index: custom_field_5 [CORE/vendors/ctctwrapper.php, line 1263]
Notice (8): Undefined index: custom_field_6 [CORE/vendors/ctctwrapper.php, line 1264]
Notice (8): Undefined index: custom_field_7 [CORE/vendors/ctctwrapper.php, line 1265]
Notice (8): Undefined index: custom_field_8 [CORE/vendors/ctctwrapper.php, line 1266]
Notice (8): Undefined index: custom_field_9 [CORE/vendors/ctctwrapper.php, line 1267]
Notice (8): Undefined index: custom_field_10 [CORE/vendors/ctctwrapper.php, line 1268]
Notice (8): Undefined index: custom_field_11 [CORE/vendors/ctctwrapper.php, line 1269]
Notice (8): Undefined index: custom_field_12 [CORE/vendors/ctctwrapper.php, line 1270]
Notice (8): Undefined index: custom_field_13 [CORE/vendors/ctctwrapper.php, line 1271]
Notice (8): Undefined index: custom_field_14 [CORE/vendors/ctctwrapper.php, line 1272]
Notice (8): Undefined index: custom_field_15 [CORE/vendors/ctctwrapper.php, line 1273]
Notice (8): Undefined index: mail_type [CORE/vendors/ctctwrapper.php, line 1274]
Notice (8): Undefined index: lists [CORE/vendors/ctctwrapper.php, line 1277]
Notice (8): Undefined index: id [CORE/vendors/ctctwrapper.php, line 1240]
Notice (8): Undefined property: Contact::$table [CORE/cake/libs/model/model.php, line 666]
Notice (8): Undefined property: Contact::$table [CORE/cake/libs/model/model.php, line 707]
Notice (8): Undefined property: Contact::$table [CORE/cake/libs/model/model.php, line 698]
Warning (2): Cannot modify header information - headers already sent by (output started at /opt/local/apache2/htdocs/outreach/cake/libs/debugger.php:673) [CORE/cake/libs/controller/controller.php, line 746]
Notice (8): Undefined property: Contact::$table [CORE/cake/libs/model/model.php, line 666]
Notice (8): Undefined property: Contact::$table [CORE/cake/libs/model/model.php, line 707]
Notice (8): Undefined property: Contact::$table [CORE/cake/libs/model/model.php, line 698]