|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
bimal Smarty Elite
Joined: 19 Apr 2007 Posts: 423
|
Posted: Fri Jun 05, 2009 2:53 pm Post subject: Tackling troubles with html editors in design view |
|
|
Out of the many good things of Smarty, it has sometimes, a problem working with design view mode in html editors.
Particularly, when you are working with the tables, the LONG variable names do not let you resize it to smaller widths.
Technically, you can switch to source edit mode and fix the widths manually.
Situation worsens, if you need to use modifiers in these variables.
Alternatively, here is one more trick with me, when you are using too longer name in the modifiers/variables comnination:
TRY TO USE AS SHORT NAME AS POSSIBLE, YET, LONG ENOUGH TO UNDERSTAND, WHAT IS MEANS.
For example, I hate number_format modfier.
Instead, I use, modifier.n.php with the below code:
Code: | <?php
/**
* Quickest number format.
* Useful to prevent stretching of the table cell because of the large text display.
*/
function smarty_modifier_n($number=0)
{
return(number_format($number, 2, '.', ','));
}
?> |
This saves space by shortening the variable name.
For example, $price|number_format... is bad over:
$price|n
This trick seems to be short and sexy. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|