for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Terranet\Administrator\Field;
use Terranet\Administrator\Scaffolding;
class Textarea extends Generic
{
const EDITOR_TINYMCE = 'tinymce';
const EDITOR_CKEDITOR = 'ckeditor';
const EDITOR_MEDIUM = 'medium';
const EDITOR_MARKDOWN = 'markdown';
/** @var array */
protected $visibility = [
Scaffolding::PAGE_INDEX => false,
Scaffolding::PAGE_EDIT => true,
Scaffolding::PAGE_VIEW => true,
];
protected $editor = false;
/**
* @param $editor
* @return bool
*/
public function editorEnabled($editor)
return $editor === $this->editor;
}
* @return $this
public function tinymce()
$this->editor = static::EDITOR_TINYMCE;
return $this;
public function ckeditor()
$this->editor = static::EDITOR_CKEDITOR;
public function medium()
$this->editor = static::EDITOR_MEDIUM;
public function markdown()
$this->editor = static::EDITOR_MARKDOWN;
* @return array
public function onEdit()
return $this->editor ? [
'dataEditor' => $this->editor,
] : [];