mirror of
https://github.com/smarty-php/smarty.git
synced 2026-04-28 18:02:07 +02:00
Implemented plugin architecture.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* Type: modifier
|
||||
* Name: count_characteres
|
||||
* Purpose: count the number of characters in a text
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_modifier_count_characters($string, $include_spaces = false)
|
||||
{
|
||||
if ($include_spaces)
|
||||
return(strlen($string));
|
||||
|
||||
return preg_match_all("/[^\s]/",$string, $match);
|
||||
}
|
||||
|
||||
/* vim: set expandtab: */
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user