我想弄清楚下面發生了什麼:Zend框架Krixton_JsonRpc_Client和呼叫方法
public function serviceAction(){
$config = Zend_Registry::get('config');
$client = new Zend_Http_Client();
$client->setAuth($config['api']['username'],$config['api']['password']);
$service = new Krixton_JsonRpc_Client($config['api']['endpoint'], $client);
switch($this->_getParam('task'))
{
case 'test':
if(!this->getParam('newsletter_id')){
$this->_helper->json(array('sent'=>false,'error'=>'Newsletter ID is invalid, must be numeric'));
return;
}
$request = $service->call('newsletter.send', array($this->_getParam('newsletter_id'),false));
$this->_helper->json($request->result));
break;
}
}
我試圖找出如何做
`Zend_Registry::get('config')`, $client->setAuth and $service->call`
的作品?
我明白_getParam('task')
是一種獲取變量或變量但不確定其他變量的方法。我查看了一些Zend文檔,但是如果有人能幫助我,那將不勝感激!