Added textarea with auto calc
This commit is contained in:
parent
3bbab271e7
commit
c5b2785e82
@ -177,5 +177,16 @@ parserRules: {
|
|||||||
public static function textarea_rows($textarea,$min=10,$char="\n") {
|
public static function textarea_rows($textarea,$min=10,$char="\n") {
|
||||||
return ($x=count(explode($char,$textarea))) < $min ? $min : $x;
|
return ($x=count(explode($char,$textarea))) < $min ? $min : $x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function textarea_width($textarea,$min=76,$char="\n") {
|
||||||
|
$x = $min;
|
||||||
|
foreach (explode($char,$textarea) as $string)
|
||||||
|
{
|
||||||
|
if (strlen($string) > $x)
|
||||||
|
$x = strlen($string);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $x;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user