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
Raw Normal View History

2013-04-25 00:22:36 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class extends Kohana's HTML
*
2013-10-08 23:24:11 +00:00
* @package lnApp
* @category Modifications
2013-04-25 00:22:36 +00:00
* @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;
}
2016-07-25 06:53:19 +00:00
public static function textarea_cols($textarea,$min=60,$char="\n") {
2016-07-25 06:53:19 +00:00
$x = $min;
foreach (explode($char,$textarea) as $string)
if (strlen($string) > $x)
$x = strlen($string);
return $x+2;
2016-07-25 06:53:19 +00:00
}
2013-04-25 00:22:36 +00:00
}
?>