I've been looking into EJS and JavaScriptMVC. I see quite a bit of value through JVMC's controllers and their models (in some cases, namely 3rd party rest integration). However, I develop in PHP using a traditional MVC such as Zend.
Typically for working with Ajax, I'll set it up just as I would any other page (model/view/controller), however instead of rendering the view, I'll return it, json_encode it and echo it out. Such as this:
echo json_encode($this->View->render('View_Name', true));
This view will have already been passed data, done it's thing, and is now returning fully rendered in a JSON object I can work with in JavaScript.
This seems simple enough. So, with this type of setup, what is the benefit of using something like EJS?
It appears I would now have to not only define a new file for a view, but also continue to use the same controllers and spit out JSON instead of just the rendered view. That JSON would then contain the data used for the EJS view. Am I missing something?
Thanks!