Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-12-30 07:25:02
- Siguo
- Member
- From: Beijing, China
- Registered: 2008-05-22
- Posts: 44
idea: add an $action arg in form function
I’m trying write a plugin and found it’s needed to add an action arg in form function.
here’s the form function in txplib_forms.php:
function form($contents, $style = ‘’, $onsubmit = ‘’, $method = ‘post’, $class = ‘’, $fragment = ‘’)
{
return n.’<form method=”’.$method.’” action=“index.php’.($fragment ? ‘#’.$fragment.’”’ : ‘”’).
($class ? ‘ class=”’.$class.’”’ : ‘’).
($style ? ‘ style=”’.$style.’”’ : ‘’).
($onsubmit ? ‘ onsubmit=“return ‘.$onsubmit.’”’ : ‘’).
‘>’.$contents.’</form>’.n;
}
hope this can be rewrite like this:
function form($contents, $style = ‘’, $onsubmit = ‘’, $method = ‘post’, $class = ‘’, $fragment = ‘’, $action = ‘index.php’)
{
return n.’<form method=”’.$method.’” action=”’.$action.($fragment ? ‘#’.$fragment.’”’ : ‘”’).
($class ? ‘ class=”’.$class.’”’ : ‘’).
($style ? ‘ style=”’.$style.’”’ : ‘’).
($onsubmit ? ‘ onsubmit=“return ‘.$onsubmit.’”’ : ‘’).
‘>’.$contents.’</form>’.n;
}
that will be very usefull for me to code my plugin.
Last edited by Siguo (2009-12-30 08:04:53)
Offline