Blame www/smarty/plugins/modifier.indent.php
|
Chris PeBenito |
696b41 |
|
|
Chris PeBenito |
696b41 |
/**
|
|
Chris PeBenito |
696b41 |
* Smarty plugin
|
|
Chris PeBenito |
696b41 |
* @package Smarty
|
|
Chris PeBenito |
696b41 |
* @subpackage plugins
|
|
Chris PeBenito |
696b41 |
*/
|
|
Chris PeBenito |
696b41 |
|
|
Chris PeBenito |
696b41 |
|
|
Chris PeBenito |
696b41 |
/**
|
|
Chris PeBenito |
696b41 |
* Smarty indent modifier plugin
|
|
Chris PeBenito |
696b41 |
*
|
|
Chris PeBenito |
696b41 |
* Type: modifier
|
|
Chris PeBenito |
696b41 |
* Name: indent
|
|
Chris PeBenito |
696b41 |
* Purpose: indent lines of text
|
|
Chris PeBenito |
696b41 |
* @link http://smarty.php.net/manual/en/language.modifier.indent.php
|
|
Chris PeBenito |
696b41 |
* indent (Smarty online manual)
|
|
Chris PeBenito |
696b41 |
* @param string
|
|
Chris PeBenito |
696b41 |
* @param integer
|
|
Chris PeBenito |
696b41 |
* @param string
|
|
Chris PeBenito |
696b41 |
* @return string
|
|
Chris PeBenito |
696b41 |
*/
|
|
Chris PeBenito |
696b41 |
function smarty_modifier_indent($string,$chars=4,$char=" ")
|
|
Chris PeBenito |
696b41 |
{
|
|
Chris PeBenito |
696b41 |
return preg_replace('!^!m',str_repeat($char,$chars),$string);
|
|
Chris PeBenito |
696b41 |
}
|
|
Chris PeBenito |
696b41 |
|
|
Chris PeBenito |
696b41 |
?>
|