Showing posts with label zf. Show all posts
Showing posts with label zf. Show all posts

2014-08-30

Sending POST/GET request with Zend Framework 1

For POST request:
$data = [
 'login' => 'admin',
 'password' => 'pass',
];
$client = new Zend_Http_Client('https://your.URL');
$client->setMethod(Zend_Http_Client::POST);
$client->setParameterPost($data);
$json = $client->request()->getBody();
For GET request:
$client = new Zend_Http_Client('https://blahblahblah.blah');
$client->setMethod(Zend_Http_Client::GET);
$client->request();

Get config in zf 1

From controller:
$config = $this->getInvokeArg('bootstrap')->getOptions();
then $config is associative array
From other places:
$config = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getOptions();