Welcome Guest, Not a member yet? Register   Sign In
Calling class functions
#1

[eluser]edhrx[/eluser]
Hi I am having a problem using a class I created

I have a class with this in it

private function makeselect($tablename, $id, $displayfield, $currentvalue = "",
$useall=""){
Load of code .........
}

which just generates a html select


further down is
public function memsys_selectMembershipTypes($current){
$s = makeselect("membership_types","id", "name", $current) ;
return $s;
}

to use is load the library
and make a call to memsys_selectMembershipTypes("")
e.g. $select = Memsys_display::memsys_selectMembershipTypes("") ;

When I run it I get 'call to undefined function makeselect etc..

I think this is something obvious but can't see the wood for trees

Ed...
#2

[eluser]xwero[/eluser]
Code:
public function memsys_selectMembershipTypes($current){
$s = $this->makeselect("membership_types”,"id", “name”, $current) ;
return $s;
}
#3

[eluser]wiredesignz[/eluser]
Actually it looks like a static function call based on the initial usage.
Code:
public function memsys_selectMembershipTypes($current)
{
    $s = self::makeselect("membership_types”,"id", “name”, $current) ;
    return $s;
}




Theme © iAndrew 2016 - Forum software by © MyBB