示例#1
0
文件: Hal.php 项目: 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);
 }
示例#2
0
文件: Hal.php 项目: 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);
 }