Subscribe to posts of this tag
I have tested Calypso performance some weeks ago and have not been able to write on it before. Don't use it please its fucking slow and cannot be optimized in the current architecture, because the template will NOT be parsed into intermediate PHP code.
Additionally there are some bugs:
I sadly have no time currently to fix any of the issues poping up with Calypso, so please don't use it for anything production.
I have got some hints about bugs and optimized the performance of loops a little bit, so that you can now download version 0.2 of the Calypso DTL template engine. Have fun.
I prepared a downloadable version of my Django Template Language Engine Clone for PHP5 and the Zend Framework (although it can easily be used Standalone). It also implements two helpers that aid in rapid ajax/Dojox deployment. You can easily specify template blocks that should be rendered by Javascript via DojoX DTL, which are then marked, compiled and shown by the client using JSON data from the server. I included a demo to show this feature.
You can grab the Tarball and there is also a README with some information. I would appreciate if anbody would test the lib and gave some feedback.
I will soon start to push this component in the ZF proposal process. I still have to finish the class structure before I can move to the Ready for Review stage. The library will max end up in Zend Extras. Therefore I will have to say again: This View Renderer shall be no replacement for the current Zend View. It is only an alternative which allows for some neat functionality and stricter View / Controller logic seperation.
UPDATE: I finished a little page for what I call the Calypso DTL. See it here: Calypso Site. I have put up a little tutorial how to get the Template Engine running with Zend Framework and as a standalone component.
This is a simple example how you would use DojoX Django Template Language component filled with data from a JSON GET Response:
<script type="text/javascript" src="/development/dojo-release-1.1.1/dojo/dojo.js" djConfig="parseOnLoad:true, isDebug:true"></script> <script language="javascript" type="text/javascript"><!-- dojo.require("dojox.dtl"); dojo.require("dojox.dtl.Context"); dojo.require("dojox.dtl.ext-dojo.NodeList"); dojo.addOnLoad( dojo.xhrGet({url: "dojotest.php", handleAs: "json", handle: function(data,ioArgs){ if(typeof data == "error"){ console.log("error?",data); } else { dojo.query("#test").dtl("I am eating {{food.fruit}} and {{food.meat}}", data); } } })); --></script>
<?php header('Content-type: text/json'); $food = array('food' => array('fruit' => 'apple', 'meat' => 'chicken')); echo json_encode($food); ?>