luwes / craft-codemirror

Add the awesome in-browser code editor CodeMirror as a field type.
MIT License
18 stars 10 forks source link

How to use in custom plugins? #12

Open bertoost opened 5 years ago

bertoost commented 5 years ago

Is it possible to use this field in custom plugins? For example;

{% if craft.app.plugins.isPluginEnabled('code-mirror') %}

    CODE MIRROR FIELD HERE

{% else %}
    {{ forms.textareaField({
        label: 'Template'|t('app'),
        name: 'template',
        value: template,
        rows: 8,
        errors: model.getErrors('template'),
    }) }}
{% endif %}

Couldn't find anything about it.. do you know?

khalwat commented 1 year ago

You can use Code Editor for this: https://github.com/nystudio107/craft-code-editor/