...

View Full Version : in oop -- how can i call a function within itself



esthera
08-28-2007, 08:51 AM
I have a function called

get_breadcrumb($mode)

how can i call the function within the function.
like

$bc = get_breadcrumbs("mymode");

this function is in a class and the line of code above is not working.

firepages
08-28-2007, 12:19 PM
$rets = $this->method();


<?php
class blah{
function blah(){
echo $this->get_breadcrumbs();
}

function get_breadcrumbs(){
echo 'blah';
}
}
?>

NancyJ
08-28-2007, 12:37 PM
to call any class method or variable use
$this->methodname();
$this->variablename
so in your case this would be

$bc = $this->get_breadcrumbs("mymode");



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum