Last active
August 29, 2015 14:22
-
-
Save guilhermewop/821b47f31a327047d137 to your computer and use it in GitHub Desktop.
Apigility client usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Controller; | |
use Zend\Mvc\Controller\AbstractActionController; | |
use Zend\View\Model\ViewModel; | |
class IndexController extends AbstractActionController | |
{ | |
public function indexAction() | |
{ | |
// $client = $this->getServiceLocator()->get('ApigilityClient\Http\Client'); | |
// or | |
$client = $this->getServiceLocator()->get('apigility.client'); | |
//$response = $client->post('path/to/service', ['param' => 'value']); | |
$response = $client->get('path/to/service', ['param' => 'value']); | |
return new ViewModel([ | |
'data' => $response | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment