Forum Moderators: coopster

Message Too Old, No Replies

undefined method.

         

mooger35

5:38 am on Aug 20, 2010 (gmt 0)

10+ Year Member



I think I've been looking at this way too long.

I'm getting this error:
Call to undefined method file_includes::top_nav()


here is the relevant code...
<?php
class file_includes
{
public function top_nav()
{
include 'includes/top_nav.php';
}
public function navigation_menu()
{
include 'includes/nav_menu.php';
}
public function left_col()
{
include 'includes/left_col.php';
}
public function footer()
{
include 'includes/footer.php';
}

}
?>

<?php
$show = new file_includes;
?>
<html>
<head>
<title>title</title>
</head>
<body>
html stuff...
<?php
$show->top_nav();
?>
more html stuff...
<?php
$show->navigation_menu();
?>
even more html stuff
<?php
$show->left_col();
?>
last bit of html stuff...
<?php
$show->footer();
?>
</body>
</html>


This works great on my test server, but is showing top_nav as undefined on my live server?!?!

If I take out $show->top_nav() all of the other methods work just fine.

Anything jump out at anyone?


php versions:
live 5.2.13
test 5.3.2

mooger35

5:59 am on Aug 20, 2010 (gmt 0)

10+ Year Member



argh... nevermind.

When uploading the file it wasn't overwriting the old php file in the www folder, just the public_html one. The old php file with the class didn't have the top_nav method and thus was undefined.

Sometimes it's just writing out the problem that gets you to the solution.

:)