editable() public method

Makes a piece of HTML editable.
public editable ( string $html, Content $content, string $field, boolean $safe ) : string
$html string The HTML to be editable
$content Bolt\Legacy\Content The actual content
$field string
$safe boolean
return string
Beispiel #1
0
 public function testEditable()
 {
     $app = $this->getApp();
     $handler = new HtmlHandler($app);
     $content = new Content($app);
     $content->setValues(['id' => 42, 'contenttype' => ['slug' => 'snail']]);
     $result = $handler->editable('<blink>Drop Bear Warning!</blink>', $content, 'paddock', false);
     $this->assertSame('<div class="Bolt-editable" data-id="42" data-contenttype="" data-field="paddock"><blink>Drop Bear Warning!</blink></div>', $result);
 }