27 lines
673 B
PHP
27 lines
673 B
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
/**
|
|
* This class extends Kohana's HTML
|
|
*
|
|
* @package lnApp
|
|
* @category Modifications
|
|
* @author Deon George
|
|
* @copyright (c) 2010 Deon George
|
|
* @license http://dev.leenooks.net/license.html
|
|
*/
|
|
abstract class lnApp_Form extends Kohana_Form {
|
|
public static function textarea_rows($textarea,$min=10,$char="\n") {
|
|
return ($x=count(explode($char,$textarea))) < $min ? $min : $x;
|
|
}
|
|
|
|
public static function textarea_cols($textarea,$min=60,$char="\n") {
|
|
$x = $min;
|
|
foreach (explode($char,$textarea) as $string)
|
|
if (strlen($string) > $x)
|
|
$x = strlen($string);
|
|
|
|
return $x+2;
|
|
}
|
|
}
|
|
?>
|