nmcteam/hifi-api

The official HiFi CMS API component for PHP

1.0.0 2015-01-22 19:58 UTC

This package is not auto-updated.

Last update: 2024-04-13 13:52:01 UTC


README

This is the official HiFi CMS API component for PHP. It lets you fetch, put, and delete HiFi CMS website content from a remote destination.

Install

Install the HiFi CMS API component with Composer:

composer require nmcteam/hifi-api

Usage

<?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'
    ]
]);

Author

Josh Lockhart josh@newmediacampaigns.com

License

MIT Public License

Copyright

Copyright 2015, New Media Campaigns. All rights reserved.