PHP code example of j7mbo / aurex

1. Go to this page and download the library: Download j7mbo/aurex library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

j7mbo / aurex example snippets


namespace Aurex\Application\Controller;

class HelloController extends AbstractController
{
    public function indexAction()
    {
        /** -- SNIP **/
    }
}

public function indexAction(GuzzleHttp\Client $client)
{
    /** @var $json A json string from the httpbin.org containing the origin ip address **/
    $json   = $client->get('http://httpbin.org/ip');
    $data   = json_decode($json, true);
    $origin = $data['origin'];
    
    return [
        'origin' => $origin
    ];
}