Вопрос

I am using kostache module in KO 3.2 - view classes, templates, everything is based on php. Is this ok, or even recommended, to install handlebars.js? Will this work properly with kostache?

I would do this straight away if it wouldnt be written in javascript though - I'm not sure how will this work, what about people who view my website without js turned on?

Это было полезно?

Решение

If you're looking for a JS templating solution then http://handlebarsjs.com/ is a fine solution. There's no reason why this should not work with kostache.

I'm not sure I understand your second paragraph there. It's a JS templating solution, so it's written in JS. If the user has JS disabled in their browser then the templates will not work, but then neither would the JS that's generating them in the first place.

Edited: It sounds to me like you may be slightly confused here too. Kostache is a server side templating engine that saves you embedding PHP logic in your views. handlerbars.js is a client-side templating engine, saving you from doing DOM manipulation to update content.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top