Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 854 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 854 Bytes

RockHeadless

A message to Russian 🇷🇺 people

If you currently live in Russia, please read this message.

SWUbanner


Customize return values

// in site/init.php
$rockheadless->return('rockblog_cover', function($page) {
  $images = $page->rockblog_cover;
  if(!is_array($images)) return;
  $file = $images[0]['data'];
  return "site/assets/files/{$page->id}/$file";
});

Note that the second parameter of the callback receives the API endpoint:

$rockheadless->return('your_field', function($page, $endpoint) {
  if($endpoint->path == '/your/page') ...
  else ...
});