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???



30.7k

Hi,

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



1.4k

how load wysiwyg editor?Please give example



30.7k

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>