Rendering Forms using Mustache Template Engine


I have a form helper and I want to render form element in my view using mustache template engine. in Volt I use "{{ form.render('elementId') }}" and everything is ok! Does anyone knows how can I render form elements with mustache like volt ?

edited Mar '14

You have to implement in your view service.

You will have to use the mustache adapter of the incubator package :

You can do it by registering it as a view engine :

Here is a sample of how i register twig : According to this example just replace the ".twig" key with ".mustache" (i dont know the usual mustach extension sorry) and replace the twig adapter in the function with the mustache one.

If my answer is not enough helpful, let me now and i will give you more details.


Tnx Soufiane. but I don't have problem for implementing Mustche into Phalcon. I use Incubator and everything is ok. I want to use Phalcon Form Helpers into views with Mustche.

edited Mar '14

@Aref it looks like your problem is more mustache related. Unfortunately I don't know much about mustache, but maybe the following question may help you :

(it is about the javascript implementation of mustache, but i think it is the same as the php one)