From 41c1b3e7af7e3d4750d14c5e884e96479e2c7dba Mon Sep 17 00:00:00 2001 From: Jitendra Khatri Date: Fri, 28 Feb 2014 15:48:45 +0530 Subject: [PATCH] For applying attributes like class, style. --- source/rb/rb/html/text.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source/rb/rb/html/text.php b/source/rb/rb/html/text.php index 523a190..dd7295b 100644 --- a/source/rb/rb/html/text.php +++ b/source/rb/rb/html/text.php @@ -10,15 +10,21 @@ class Rb_HtmlText { - static function filter($name, $view, Array $filters = array(), $prefix='filter_payplans') + function filter($name, $view, Array $filters = array(), $prefix='filter_payplans', $attrs = array()) { $elementName = $prefix.'_'.$view.'_'.$name; $elementValue = @array_shift($filters[$name]); $html = ''; + .'value="'.$elementValue.'" '; + + if(!empty($attrs)){ + foreach ($attrs as $attr => $attrValue){ + $html .= ' '.$attr.'="'.$attrValue.'"'; + } + } + $html .= '/>'; return $html; }