Passing objects into methods or functions
| From: | Gerard Samuel | Date: | Mon, 23 Jun 2003 06:20:30 +0000 |
| Subject: | Passing objects into methods or functions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-152477@lists.php.net to get a copy of this message | ||
Im trying to pass an object into functions and class methods, and for some
reason, Im unable to access the object's methods.
When I var_dump() the object, its a valid object with the function or class method.
When I check via get_class_methods, all the methods are there, from within the function or class method.
I tried passing by reference, and the regular "copied" way.
I end up with the error ->
Fatal error: Call to undefined function: display_thumbnails() in ......
I can access the object's variables, but not it's methods
Maybe because Im tired, but if anyone experienced this before, I'd
greatly appreciate any feed back on this.
Thanks
----------------
class class
{
var $_tpl;
var $gal_tpl = array();
function gallery_class(&$tpl)
{
if (is_object( $tpl ))
{
$this->_tpl = $tpl;
}
}
}
?>