PHP code example of divengine / ajaxmap

1. Go to this page and download the library: Download divengine/ajaxmap 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/ */

    

divengine / ajaxmap example snippets




use divengine\ajaxmap;

function sum($x, $y){
  return $x + $y; 
}

class Enterprise{
  public static function getEmployees(){
      return [
        ["name" => "Thomas Hardy", "salary" => 1500],  
        ["name" => "Christina Berglund", "salary" => 1200] 
      ];  
    } 
}

// Server instance ...

$server = new ajaxmap(); 

// ... Add methods ...

$server->addMethod("sum"); 
$server->addClass("Enterprise"); 

// ... and go!
$server->go();