Re: [SMARTY] input type text
| From: | Paul Lockaby | Date: | Sat, 22 Mar 2003 22:20:58 +0000 |
| Subject: | Re: [SMARTY] input type text | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8834@lists.php.net to get a copy of this message | ||
Elgi wrote:
Hello smarty-general, I search a plugin for input type text Don't exist ? And if no, what do you do ?I use this one right here that I made:
/* * Smarty plugin * ------------------------------------------------------------- * Function: html_input * Purpose: inserts an text field on the html page * ------------------------------------------------------------- */ function smarty_function_html_input($params, &$smarty) { extract($params); if (!isset($name) || empty($name)) { $smarty->trigger_error("assign: missing 'name' parameter"); return; } $html_result = ""; $html_result = "<INPUT TYPE="; if ($password == true) { $html_result .= "PASSWORD"; } else { $html_result .= "TEXT"; } if (isset($size)) { $html_result .= " SIZE=$size"; } if (isset($length)) { $html_result .= " MAXLENGTH=$length"; } if (isset($value)) { $html_result .= " VALUE=\"".htmlspecialchars($value)."\""; } else { $html_result .= " VALUE=\"\""; } $html_result .= " NAME=\"$name\">"; return $html_result; }-- Paul Lockaby paul@paullockaby.com http://www.paullockaby.com