Adds Workable API integration to SilverStripe projects. See https://workable.readme.io/ for API docs.
First, add your API key using a constant, preferably in your .env
file.
WORKABLE_API_KEY="your_api_key"
Then, just add your subdomain to the config.
SilverStripe\Workable\Workable:
subdomain: example
Right now, only one API call is available.
$params = ['state' => 'published'];
Workable::create()->getJobs($params);
This returns an ArrayList
, so you can iterate over it on the template.
<% loop $Jobs %>
$Title, $Url
<% end_loop %>
For nested properties, you can use the dot-separated syntax.
<% loop $Jobs %>
$Title ($Location.City)
<% end_loop %>
The Workable API returns is properties in snake_case
. Simply convert these to UpperCamelCase
to call them on each result.
$FullTitle, $Url, $ZipCode, $Department, $CreatedAt