We Recommend

Smarty PHP Template Programming And Applications Smarty PHP Template Programming And Applications
Smarty is a templating engine for PHP. Designers who are used to working with HTML files can work with Smarty templates, which are HTML files with simple tags while programmers work with the underlying PHP code. The Smarty engine brings the code and templates together. The result of all this is that designers can concentrate on designing, programmers can concentrate on programming, and they don't need to get in each others way so much.


Posted By

micmath on 10/30/07


Tagged


Versions (?)


Short preview in Smarty is...


Published in: Smarty 


Short preview in Smarty is generated from longer text like this.


  1. {$article|strip_tags|substr:0:25}{if strlen($article) > 25}...{/if}

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: micmath on March 11, 2008

That would be {$article|strip_tags|truncate:25}

Posted By: mbandion on January 28, 2008

I would recommend: truncate

http://www.smarty.net/manual/en/language.modifier.truncate.php

You need to login to post a comment.