English
, en-US
, or en-GB
.
es-ES
for Spanish.<?php
// Tip: Find more about PHP SDKs at https://kontent.ai/learn/php
// Defined by Composer to include required libraries
require __DIR__ . '/vendor/autoload.php';
use Kontent\Ai\Delivery\DeliveryClient;
$client = new DeliveryClient('8d20758c-d74c-4f59-ae04-ee928c0816b7');
// Gets a specific article in Spanish
$items = $client->getItem('about_us', (new QueryParams())
->language('es-ES'));
?>
<?php
// Tip: Find more about PHP SDKs at https://kontent.ai/learn/php
// Defined by Composer to include required libraries
require __DIR__ . '/vendor/autoload.php';
use Kontent\Ai\Delivery\DeliveryClient;
$client = new DeliveryClient('8d20758c-d74c-4f59-ae04-ee928c0816b7');
// Filters all articles to find the Spanish variant by its URL slug
$items = $client->getItems((new QueryParams())
->language('es-ES')
->equals('system.type', 'article')
->equals('elements.url_pattern', 'acerda-de-nosotros'));
?>
<?php
// Tip: Find more about PHP SDKs at https://kontent.ai/learn/php
// Defined by Composer to include required libraries
require __DIR__ . '/vendor/autoload.php';
use Kontent\Ai\Delivery\DeliveryClient;
$client = new DeliveryClient('975bf280-fd91-488c-994c-2f04416e5ee3');
// Gets content items in Spanish without following language fallbacks
$items = $client->getItems((new QueryParams())
->language('es-ES')
->equals('system.language', 'es-ES'));
?>