How to pass parameters in the registered function
| From: | Semenov Dmitry | Date: | Tue, 18 Feb 2003 11:06:11 +0000 |
| Subject: | How to pass parameters in the registered function | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7817@lists.php.net to get a copy of this message | ||
Hello I have the following function
function search_form($search_field_array, $script_name)
{
?>
<form name="search_form" method="post"
action="<?=$script_name?>" style="display:inline;">
<?
la la la la la
and foreach actions with thr $search_field_array
}
In my smarty I did the follwing
$smarty->register_function("search_form", "search_form");
My template contain the next smarty tag
{search_form}
And here is the problem
After the tempate was parsed I see the following html code inside it
<form name="search_form" method="post" action="Object"
style="display:inline;"
How can I set the parameters for my function?
I do not like to see "Object" as my action, I want to see test.php for
example there.
Help me please.
Best wishes,
Dmitry.