PHP code example of slations / directus-php-sdk

1. Go to this page and download the library: Download slations/directus-php-sdk 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/ */

    

slations / directus-php-sdk example snippets


 

e 'vendor/autoload.php'; // Include the composer autoload - COMPOSER

$directus = new Slations\DirectusSdk\Directus("https://url.to.your.directus.install.io/");


$directus->get_items('articles', array(
  search => "",
  filter => array(
    "date_published" => array(
      "_gte" => "\$NOW" // If you use Directus provided dynamic options like $NOW make sure you ascape the item \$NOW so PHP knows it's not a PHP variable
    )
  )
));