您好我正在尝试将组件导入shell,这是我的代码
<?php
App::import('Component', 'OptimalPayment');
class PushEftShell extends Shell {
var $uses = array('User' , 'Payment');
function main() {
$OptimalPayment = OptimalPaymentComponent();
$Organsation = $this->Organisation->find('all', array(
'fields' => array('id', 'name'),
'contain' => array(
'ContactPerson', 'BankDetail', 'Address', 'Phone'
)
));
}
}
?>
并且我有这个错误消息
Fatal error: Class 'Component' not found in C:\web\appName\app\controllers\components\optimal_payment.php on line 24
我的导入有什么问题?
TIA
答案 0 :(得分:1)
在CakePHP 1.3中,您应该按Object
扩展组件类。这意味着你应该写如下:
class OptimalPaymentComponent extends Object{
.............
}