add wordwrap and indent to repository

This commit is contained in:
mohrt
2002-03-15 07:08:17 +00:00
parent d2416b1571
commit ba8e369f61
4 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* Type: modifier
* Name: indent
* Purpose: indent lines of text
* -------------------------------------------------------------
*/
function smarty_modifier_indent($string,$chars=4,$char=" ")
{
return preg_replace('!^!m',str_repeat($char,$chars),$string);
}
?>

View File

@@ -0,0 +1,16 @@
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* Type: modifier
* Name: wordwrap
* Purpose: wrap a string of text at a given length
* -------------------------------------------------------------
*/
function smarty_modifier_wordwrap($string,$length=80,$break="\n",$cut=false)
{
return wordwrap($string,$length,$break,$cut);
}
?>

View File

@@ -0,0 +1,16 @@
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* Type: modifier
* Name: indent
* Purpose: indent lines of text
* -------------------------------------------------------------
*/
function smarty_modifier_indent($string,$chars=4,$char=" ")
{
return preg_replace('!^!m',str_repeat($char,$chars),$string);
}
?>

View File

@@ -0,0 +1,16 @@
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* Type: modifier
* Name: wordwrap
* Purpose: wrap a string of text at a given length
* -------------------------------------------------------------
*/
function smarty_modifier_wordwrap($string,$length=80,$break="\n",$cut=false)
{
return wordwrap($string,$length,$break,$cut);
}
?>