Esempio n. 1
0
File: Hal.php Progetto: BWorld/hal-1
 /**
  * Return the current object in a application/hal+json format (links and
  * resources).
  *
  * @param bool $pretty
  *   Enable pretty-printing.
  * @return string
  */
 public function asJson($pretty = false)
 {
     $renderer = new HalJsonRenderer();
     return $renderer->render($this, $pretty);
 }
Esempio n. 2
0
File: Hal.php Progetto: solvire/hal
 /**
  * Return the current object in a application/hal+json format (links and
  * resources).
  *
  * @param bool $pretty
  *   Enable pretty-printing.
  * @param bool $encode
  *   Run through json_encode
  * @return string
  */
 public function asJson($pretty = false, $encode = true)
 {
     $renderer = new HalJsonRenderer();
     return $renderer->render($this, $pretty, $encode);
 }