aircms/aircms-php

该包的最新版本(dev-main)没有可用的许可信息。

Aircms PHP API 客户端

dev-main 2022-02-12 01:01 UTC

This package is auto-updated.

Last update: 2024-09-12 06:38:00 UTC


README

Aircms PHP API 客户端

需求

  • PHP 7.3 或更高版本

文档

安装

composer require aircms/aircms-php

开始使用

use Aircms\Aircms;

$aircms = new Aircms;

$aircms->setApiKey('<api_key>');

获取所有页面

$aircms->getPages();

// [
//     [
//         "name" => "startpage"
//         "uuid" => "948a3718-a454-42df-9d87-a0d5214da6a0"
//         "created_at" => "2021-10-02T20:25:07.000000Z"
//         "updated_at" => "2021-10-11T15:41:49.000000Z"
//         "cached_at" => "2021-10-11T15:41:49.000000Z"
//         "cache_disabled" => false
//     ]
// ]

获取页面信息

$aircms->getPage('startpage');

// [
//     "name" => "startpage"
//     "uuid" => "948a3718-a454-42df-9d87-a0d5214da6a0"
//     "created_at" => "2021-10-02T20:25:07.000000Z"
//     "updated_at" => "2021-10-11T15:41:49.000000Z"
//     "cached_at" => "2021-10-11T15:41:49.000000Z"
//     "cache_disabled" => false
// ]

获取页面字段

$aircms->getPageFields('startpage');

// [
//     'sv' => [
//         'hero_text' => 'Välkommen'
//     ]
// ]