title: how to link return in the callback to Codeigniter Model return
body: <p>can i get model Return Value?</p>
  
  <p>use Web3.php callback in the Codeigniter Model.</p>
  
  <p>I tried it, but it was empty.</p>
  
  <p>how to link return in the callback to CI Model return.</p>
  
  <p>1.Model</p>
  
  <pre><code>use Web3\Web3;
  use Web3\Contract;
  use Web3\Providers\HttpProvider;
  use Web3\RequestManagers\HttpRequestManager;
  
  class Dapps_model extends CI_Model {
  
  public function getItemFromDapps( $item_id ){
      $at     = "0xMYDAPPSADDRESS";
      $json   = file_get_contents( APPPATH . "/config/abi.json" , FALSE );
      $json   = json_decode( $json , TRUE );
      $abi    = json_encode( $json["abi"] );
      $provider = new HttpProvider( new HttpRequestManager('https://ropsten.infura.io/MYAPIKEY') );
      $contract = new Contract( $provider , $abi );
      $contract-&gt;at( $at );
      $contract-&gt;call( "getItemInfo" , $item_id , function( $err, $item ){
          if ( $err !== null ) {
              var_dump(  $err-&gt;getMessage() );
              exit;
          }
          // var_dump( $item ); Data exists.
          return $item;
      });
  }
  </code></pre>
  
  <p>2.Controller</p>
  
  <pre><code>$item   = $this-&gt;Dapps_model-&gt;getItemFromDapps( 2 );
  var_dump( $item ) is Null
  </code></pre>
  
  <p>Add</p>
  
  <p>I was able to get the Model return value on the Controller.
  With Oluwafemi help.
  Is this correct use?</p>
  
  <pre><code>$returnData = null;
  $contract-&gt;call( "getItemInfo" , $item_id , function( $err, $item ) use ( &amp;$returnData ){
      if ( $err !== null ) {
          var_dump(  $err-&gt;getMessage() );
          exit;
      }
      // var_dump( $item ); Data exists.
      //return $item;
      $returnData = $item;
  });
  return $returnData;
  </code></pre>