The Mustache implementation in PHP is named Mustache.php, and you can grab a copy of the library using from the official GitHub project page. In this article I’ll focus on creating server-side Mustache templates and sharing the same set of templates with client-side JavaScript. If you don’t have any previous experience working with Mustache, I recommend reading it. In my article Creating HTML Templates with Mustache.js on JSPro, I showed you how to work with Mustache templates in client-side code. Mustache is quickly becoming one of the more popular templating engines among those available, and provides implementations for different programming languages and platforms to cater to our needs. Hence it can be useful to choose a templating engine which provides both client- and server-side support which allows maximum reusability. In scenarios where your web application depends heavily on Ajax, it can be difficult to maintain both server-side and client-side templates without duplication. There are two types of templates: server-side templates, which are used through a server-side templating engine during the initial page load, and client-side templates, which are used for working with JavaScript-based applications or Ajax requests. Templating in web applications is crucial for separating your business logic from your presentation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |