Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12742627
modifiercompiler.count_paragraphs.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
669 B
Referenced Files
None
Subscribers
None
modifiercompiler.count_paragraphs.php
View Options
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty count_paragraphs modifier plugin
*
* Type: modifier<br>
* Name: count_paragraphs<br>
* Purpose: count the number of paragraphs in a text
*
* @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php
* count_paragraphs (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function
smarty_modifiercompiler_count_paragraphs
(
$params
,
$compiler
)
{
// count \r or \n characters
return
'(preg_match_all(
\'
#[
\r\n
]+#
\'
, '
.
$params
[
0
]
.
', $tmp)+1)'
;
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 16, 13:51 (9 m, 34 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3156313
Default Alt Text
modifiercompiler.count_paragraphs.php (669 B)
Attached To
Mode
rOBSIDIAN Obsidian Workspaces
Attached
Detach File
Event Timeline
Log In to Comment