Skip to content

[Feature] Multiple namespaces to look for endpoints#20

Open
zoliszabo wants to merge 2 commits into
varsitynewsnetwork:masterfrom
zoliszabo:feature/multiple-endpoint-namespaces
Open

[Feature] Multiple namespaces to look for endpoints#20
zoliszabo wants to merge 2 commits into
varsitynewsnetwork:masterfrom
zoliszabo:feature/multiple-endpoint-namespaces

Conversation

@zoliszabo

@zoliszabo zoliszabo commented Oct 24, 2018

Copy link
Copy Markdown

Adds possibility to define multiple locations (namespaces) where WpClient can look after endpoints.
This feature is useful where custom, domain-specific endpoints are used.

How to use:

Your new endpoint (notice the namespace):

namespace Your\Special\Endpoint;

use Vnn\WpApiClient\Endpoint\AbstractWpEndpoint; 

class Examples extends AbstractWpEndpoint
{
...
}

And where it is added to WpClient:

$client = new WpClient(...);
$client->addEndpointNamespace('Your\Special\Endpoint\\');
$client->examples()->get(1);

@pekka

pekka commented Jan 20, 2023

Copy link
Copy Markdown

This PR was a huge help for me today - thank you!

@zoliszabo

Copy link
Copy Markdown
Author

This PR was a huge help for me today - thank you!

You're welcome! :)

@zack-carlson

Copy link
Copy Markdown

#29 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants