We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

wysiwyg editor

How to add wysiwyg editor in form

Phalcon's Form does not offer this right out of the box.

You can either extend the form elements to support a WYSIWYG editor or just add the relevant element in the view directly

After more than an year, still @Phalcon doesn't support this???



43.9k

Hi,

phalcon's offers you all the tool you need to load the wysiwyg editor of your choice in your app.



2.9k

how load wysiwyg editor?Please give example



43.9k

Hi,

Supposing that you need modernizr and jquery application wide.


class ControllerBase extends Controller
{
// assets are in public/css and public/js
    public function initialize()
    {
        $this->assets
            ->collection('headerCss')
            ->addCss('css/normalize.css')
            ->addCss('css/foundation.min.css')
            ;
        $this->assets
            ->collection('footer')
            ->addJs('js/modernizr')
            ->addJs('js/jquery.min.js');            
    }

In a given controller you've got a newAction for displaying your form.


    public function newAction()
    {
        $this->assets
            ->collection('footer')
            ->addJs('js/tinymce/tinymce.min.js')
            ->addJs('js/ajaxupload.js')
            ;
    }

In you main layout view:

    <head>
        {{ assets.outputCss('headerCss') }}
    </head>
    <body>
// ....
// code
        {{ assets.outputJs('footer') }}
    </body>
</html>