php-mvc icon indicating copy to clipboard operation
php-mvc copied to clipboard

TinyMCE editor

Open pagodzik opened this issue 4 years ago • 1 comments

Hi

I installed TinyMCE by composer. So we have path "/vendor/tinymce/tinymce/tinymce.js" How should I include this to my twig html? All js I have in public/js/ - shoud I move there also tinymce files ?

Regards

pagodzik avatar Jan 28 '21 16:01 pagodzik

Composer was designed for PHP packages, i.e. PHP code that will be used on the server. By design, files not in the public folder can't be accessed in a browser, so you can't access that JavaScript file in the browser. You have a couple of options - for TinyMCE, the simplest is to load it from a CDN - details here (scroll down to "Get Started with TinyMCE").

Alternatively you could copy the relevant files from the vendor folder to the public folder, you can do this manually or use a Composer script to do this automatically every time the package is updated.

daveh avatar Jan 29 '21 06:01 daveh