Quantcast
Channel: Live News for Yii Framework
Viewing all articles
Browse latest Browse all 3361

[extension] luyadev/luya-headless

$
0
0

LUYA Logo

LUYA Headless Client

  1. Installation
  2. Intro
  3. Documentation
  4. Development and Contribution

A client library to access content from the LUYA APIs (or any other REST API).

LUYA Build Status Latest Stable Version Maintainability Test Coverage Total Downloads Slack Support

Compared to the other LUYA packages, this package adheres to Semantic Versioning!

Installation

Add the LUYA headless client library to your composer.json:

composer require luyadev/luya-headless

Intro

Quick intro about how to use the headless library with existing built in active endpoints:

use luya\headless\Client;
use luya\headless\modules\admin\ApiAdminUser;

// build client object with token and server infos
$client = new Client('API_TOKEN', 'http://localhost/luya-kickstarter/public_html');

// find a given user by its ID
$user = ApiAdminUser::findOne(1, $client);

// iterate all users
$users = ApiAdminUser::find()->setSort(['id' => SORT_ASC])->all($client);
foreach ($users->getModels() as $user) {
      echo $user->firstname . ' ' . $user->lastname;
}

Documentation

See the full Documentation in order to see how to make put, delete or post request, handle pagination or access the cms blocks.

Development and Contribution


Viewing all articles
Browse latest Browse all 3361

Trending Articles