Get Smarty

Donate

Donate Bitcoin Bitcoin
Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Largest classified with thousands of ads at Shoppok

Buy cheap eyeglasses from Cheapglasses123.com and save up to 80%.

Buy wedding dresses on SiteSteer.com - Best Online Wedding Dress Store

Buy prescription glasses from www.australiaglasses.com and save.

Cheap Glasses Now On Sale at GlassesPeople.com. Starts At $7.95.

Where to buy discount wedding dresses and cheap smart dresses free shipping - Weddingdresstrend.com

Find Wedding Dresses Online at Canada from Ca-dresses.com

wordwrap

Posición del Parametro Tipo Requerido Default Descripción
1 integer No 80 Este determina en cuantas columnas cortar.
2 string No \n Esta es la cadena usada para cortar.
3 boolean No false Este determina cuando cortar o no, o al final de una palabra(false), o en un carácter exacto(true).

Este wordwrap corta una cadena para un ancho de columna, el default es 80. Como segundo parámetro opcional, usted puede especificar la cadena que será usada para cortar el texto para la próxima linea (el default es un retorno de carro \n). Por default, (wordwrap) intentara cortar al final de una palabra. Si usted quisiera cortar un tamaño exacto de cacarteres, pase al tercer parámetro, que es opcional, como true. Este es equivalente a la función wordwrap() de PHP.

Example 5.22. wordwrap


<?php
    
$smarty->assign('articleTitle', "Blind woman gets new kidney from dad she hasn't seen in years.");

?>

   

Donde index.tpl es:

 
{$articleTitle}

{$articleTitle|wordwrap:30}
    
{$articleTitle|wordwrap:20}
    
{$articleTitle|wordwrap:30:"<br />\n"}
    
{$articleTitle|wordwrap:30:"\n":true}

   

Esta es la Salida:


Blind woman gets new kidney from dad she hasn't seen in years.

Blind woman gets new kidney
from dad she hasn't seen in
years.

Blind woman gets new
kidney from dad she
hasn't seen in
years.

Blind woman gets new kidney<br />
from dad she hasn't seen in<br />
years.

Blind woman gets new kidney
from dad she hasn't seen in
years.

   

Ver También nl2br y {textformat}.

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 20 plus 15? (Are you human?)

Sponsors [info]

UK Web Hosting @webhost.uk.net
Best Web Hosting @rshosting.com
Web Hosting UK @webhostinguk.com
Unlimited Web Hosting @infrenion.com
App Entwicklung @morphodo.com
Buy from China @dhgate.com
First Click Internet Marketing @fcinternetmarketing.com