Re: [SMARTY] input type text
| From: | Paul Lockaby | Date: | Sat, 22 Mar 2003 22:51:15 +0000 |
| Subject: | Re: [SMARTY] input type text | ||
| References: | 1 2 3 4 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8838@lists.php.net to get a copy of this message | ||
For your textarea implementation, you might want to add a WRAP=VIRTUAL attribute in. I find it makes it so that the textbox actually works correctly. Other than that, your textarea function looks exactly like the one I have :)
Elgi wrote:
Hello Paul,
It's good thanks and i have made
{html_textaera} with your plugin ;))
I don't test in this time.
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* Function: html_textaera
* Purpose: inserts an textaera field on the html page
* -------------------------------------------------------------
*/
function smarty_function_html_textaera($params, &$smarty) {
extract($params);
if (!isset($name) || empty($name)) {
$smarty->trigger_error("assign: missing 'name' parameter");
return;
}
$html_result = "";
$html_result = "<textarea";
if (isset($rows)) {
$html_result .= " rows=$rows";
}
if (isset($cols)) {
$html_result .= " cols=$cols";
}
$html_result .= " name=\"$name\">";
if (isset($value)) {
$html_result .= htmlspecialchars($value);
}
$html_result .= "</textarea>";
return $html_result;
}
?>
--
Paul Lockaby
paul@paullockaby.com
http://www.paullockaby.com