Patch : ghost delimiting

From: Date: Wed, 05 Jun 2002 12:07:40 +0000
Subject: Patch : ghost delimiting
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-110@lists.php.net to get a copy of this message
Hi I am currently developing a php based intranet for a company, using Smarty. We are 2 on this project : me the coder, and a graphist. And trust me, i am not a graphist, and she is not a coder ;) When I discovered Smarty at early stages of this project, I immediatly noticed how the documentation is clearly separating the roles of designer and coder. This is what we needed. But, now in implementation stage, there is a real problem : What we want are templates which are fully viewable in a browser, so that she can immediatly see how her images render, and how the design suit them. Meanwhile these templates must be exploitable without any change by the application to generate dynamic pages. And a part of the view logic is handled in the templates with {if} statements, which helps much the whole development. But this results in (very) messed up templates, that is : unviewable. So i made a few changes to Smarty 2.1.1, which allow to do this : <td align="center" class="blue"> <!--{if $ActiveColor eq "blue" }--> Blue <!--{else} <a href="{$BlueAction}" class="grey"> Blue </a> {/if}--> </td> In this example, a left delimiter can be { or <!--{ and a right delimiter can be } or }-->. The templates just get crunchy to browse at :) To enable or disable this behaviour, I added the "var $ghost_delimiting" boolean option. Here is the patch + a demo : http://dre18.mine.nu/patchfabrik/Smarty-2.1.1-ghost_delim Tell me what you think about it. --og

« previous php.smarty.dev (#110) next »