Example #1
0
 /**
  * Handles editable type
  *
  * @param \BEM\Context $ctx
  * @param \BEM\Json    $json
  *
  * @return mixed
  */
 public function handleEditable(Context $ctx, Json $json, $editable)
 {
     $ctx->tag('a');
     $ctx->attr('data-is-link', 1);
     $ctx->content("<?= ArrayHelper::getValue(\${$this->target($editable)}, \"{$editable['key']}.anchor\", '#UNDEFINED') ?>");
     $ctx->attr('href', ['unsafe' => "<?= ArrayHelper::getValue(\${$this->target($editable)}, \"{$editable['key']}.href\", '#UNDEFINED') ?>"]);
 }