示例#1
0
 /**
  * Возвращает/устанавливает защищенное содержимое в зависимости от аргументов.
  * **force** — задать содержимое даже если оно было задано ранее.
  * ```javascript
  * bh.match('input', function(ctx) {
  *     ctx.content({ elem: 'control' });
  * });
  * ```
  * @param array|Json [$value]
  * @param boolean [$force]
  * @return array|Json|Context
  */
 public function content($value = null, $force = false)
 {
     if (func_num_args() === 0) {
         return !is_null($this->ctx->content) ? $this->ctx->content : null;
     }
     if (is_null($this->ctx->content) || $force) {
         $this->ctx->setContent($value);
     }
     return $this;
 }