2017 © Pedro Peláez
 

library silex-wpapi-service-provider

WordPress API Service Provider for Silex

image

nunopress/silex-wpapi-service-provider

WordPress API Service Provider for Silex

  • Friday, November 4, 2016
  • by namaless
  • Repository
  • 1 Watchers
  • 1 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Introduction

This is a Service Provider for Silex and added the access to WordPress API websites easy., (*1)

Installation

You can simply install with composer:, (*2)

composer require nunopress/silex-wpapi-service-provider, (*3)

In your Silex application register the service provider:, (*4)

$app->register(new NunoPress\Silex\WpApi\Provider\WpApiServiceProvider());

Configuration

You can configure this items inside the container:, (*5)

wpapi.client

With default the service provider use GuzzleHttp client, but you can use what you want, you need to implement our NunoPress\Silex\WpApi\WpApiClientInterface., (*6)

wpapi.client.option

If you use our client you can pass GuzzleHttp options here, most useful for the base_uri instead to use all times the full uri or for the authentication., (*7)

Usage

This is our interface for get default WordPress API endpoint's and we added one method for call the Advanced Custom Fields API (_you need a WordPress plugin ACF Rest API_)., (*8)

Example for get the first page from pages in order by menu_order and asc:, (*9)

$wpapi->getItems('pages', 'menu_order', 'asc', 1)

If you want get the Advanced Custom Fields options page you can do it:, (*10)

$wpapi->getAcf('options')

API

/**
 * @param string $type
 * @param string $orderBy
 * @param string $order
 * @param int $page
 *
 * @return array
*/
public function getItems($type = 'posts', $orderBy = 'menu_order', $order = 'desc', $page = 1)
/**
 * @param string $type
 * @param null|int $id
 *
 * @return array
 */
public function getAcf($type, $id = null)

The Versions

04/11 2016

dev-master

9999999-dev

WordPress API Service Provider for Silex

  Sources   Download

MIT

The Requires

 

wordpress silex service provider wpapi

04/11 2016

v1.1.2

1.1.2.0

WordPress API Service Provider for Silex

  Sources   Download

MIT

The Requires

 

wordpress silex service provider wpapi

04/11 2016

v1.1.1

1.1.1.0

WordPress API Service Provider for Silex

  Sources   Download

MIT

The Requires

 

wordpress silex service provider wpapi

04/11 2016

v1.1.0

1.1.0.0

WordPress API Service Provider for Silex

  Sources   Download

MIT

The Requires

 

wordpress silex service provider wpapi

04/11 2016

v1.0.2

1.0.2.0

Silex WordPress API Service Provider

  Sources   Download

MIT

The Requires

 

02/11 2016

v1.0.1

1.0.1.0

Silex WordPress API Service Provider

  Sources   Download

MIT

The Requires

 

31/10 2016

v1.0.0

1.0.0.0

Silex WordPress API Service Provider

  Sources   Download

MIT

The Requires