示例#1
0
 /**
  * @param PayloadInterface $payload
  *
  * @return string
  */
 private function render(PayloadInterface $payload)
 {
     $template = $payload->getSetting('template');
     $output = $payload->getOutput();
     return $this->engine->render($template, $output);
 }
 /**
  * @param Template $template
  * @param PayloadInterface $payload
  * @return string
  */
 protected function render(Template $template, PayloadInterface $payload)
 {
     return $template->render($payload->getOutput());
 }
 /**
  * Determine if the payload has usable output
  *
  * @param PayloadInterface $payload
  *
  * @return boolean
  */
 protected function hasOutput(PayloadInterface $payload)
 {
     return (bool) $payload->getOutput();
 }
 /**
  * @inheritDoc
  */
 public function body(PayloadInterface $payload)
 {
     return json_encode($payload->getOutput(), $this->options());
 }