This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
lnapp/classes/lnApp/Form.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;
}
}
?>