Creating a non translatable textarea component and make it usable with same @editor directive

parent 4f552936
......@@ -16,6 +16,7 @@ class AsgardEditorDirective
if ($this->lang !== null) {
return asgard_i18n_editor($this->fieldName, $this->labelName, $this->content, $this->lang);
}
return asgard_editor($this->fieldName, $this->labelName, $this->content);
}
/**
......
@component($editor->getComponentName(), compact('fieldName', 'labelName'))
{!! $content !!}
@endcomponent
@if ($editor->getEditorCssPartial() !== null)
@if (Cache::store('array')->add('textareaCssLoaded', true, 100))
@include($editor->getEditorCssPartial())
@endif
@endif
<div class='{{ $errors->has($fieldName) ? ' has-error' : '' }}'>
{!! Form::label($fieldName, $labelName) !!}
<textarea class="{{ $editor->getEditorClass() }}" name="{{ $fieldName }}" rows="10" cols="80">{{ $slot }}</textarea>
{!! $errors->first($fieldName, '<span class="help-block">:message</span>') !!}
</div>
@if ($editor->getEditorJsPartial() !== null)
@if (Cache::store('array')->add('textareaJsLoaded', true, 100))
@include($editor->getEditorJsPartial())
@endif
@endif
......@@ -40,3 +40,11 @@ if (! function_exists('asgard_i18n_editor')) {
return view('core::components.i18n.textarea-wrapper', compact('fieldName','labelName', 'content', 'lang'));
}
}
if (! function_exists('asgard_editor')) {
function asgard_editor($fieldName, $labelName, $content)
{
return view('core::components.textarea-wrapper', compact('fieldName','labelName', 'content'));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment