nmcteam / hifi-api
PHP官方HiFi CMS API组件
1.0.0
2015-01-22 19:58 UTC
Requires
- php: >=5.4.0
- guzzlehttp/guzzle: ~5.0
This package is not auto-updated.
Last update: 2024-09-14 16:13:39 UTC
README
这是PHP官方HiFi CMS API组件。它允许您从远程位置获取、存储和删除HiFi CMS网站内容。
安装
使用Composer安装HiFi CMS API组件
composer require nmcteam/hifi-api
用法
<?php
$hifi = new \Hifi\Api('www.example.com', 'username', 'password');
// Fetch content
$hits = $hifi->get([
'type' => 'page'
]);
foreach ($hits as $hit) {
echo $hit->title;
}
// Create or update content
$hifi->post([
[
'type' => 'page',
'title' => 'New page',
'content' => 'Content goes here',
'parent' => 'a24c85d34ce9437bbfc9db696ccee814'
]
]);
// Delete content
$hifi->delete([
[
'id' => 'a24c85d34ce9437bbfc9db696ccee814'
]
]);
作者
Josh Lockhart josh@newmediacampaigns.com
许可证
MIT公共许可证
版权
版权所有 2015,新传媒运动。保留所有权利。