我有一个在类中的函数,我想要一个函数中的 var。我$this
用来从类中的函数调用 var 。但不知道如何使用参数调用函数。我想$post['who']['points']
使用外部功能。
功能
function post_meta_who($post, $class)
{
if (isset($post['who'])) {
$this->output('<SPAN CLASS="'.$class.'-who">');
if (strlen(@$post['who']['prefix']))
$this->output('<SPAN CLASS="'.$class.'-who-pad">'.$post['who']['prefix'].'</SPAN>');
if (isset($post['who']['data']))
$this->output('<SPAN CLASS="'.$class.'-who-data">'.$post['who']['data'].'</SPAN>');
if (isset($post['who']['title']))
$this->output('<SPAN CLASS="'.$class.'-who-title">'.$post['who']['title'].'</SPAN>');
// You can also use $post['level'] to get the author's privilege level (as a string)
if (isset($post['who']['points'])) {
$post['who']['points']['prefix']='('.$post['who']['points']['prefix'];
$post['who']['points']['suffix'].=')';
$this->output_split($post['who']['points'], $class.'-who-points');
}
if (strlen(@$post['who']['suffix']))
$this->output('<SPAN CLASS="'.$class.'-who-pad">'.$post['who']['suffix'].'</SPAN>');
$this->output('</SPAN>');
}
}