I recently ported a site over from XAMPP on a MacBook Air to the Sites folder on a MacBook Pro. PHP works MySQL works. But my site is no longer functions due to some problem with the “routes” array that creates file paths. I’m using the Ninja framework set out in Butler and Yank’s PHP & MYSQL Novice to Ninja. It all worked great before! But now I get an error, “Method name must be a string in /Users/…/EntryPoint.php:56.” The “run()” method isn’t working, and I suspect the problem may be somewhere in my “routes” array. When I print_r the array, it looks okay, except for the very beginning:
Array (  => Array ( [GET] => Array ( [controller] => ...
The first item is empty. Shouldn’t it contain the name of my site, so that the run() method can piece together the file path? If so, why doesn’t it? How can I fix it?
The lines in EntryPoint.php that aren’t working seem to be these:
$controller = $routes[$this->route][$this->method]['controller']; $action = $routes[$this->route][$this->method]['action']; $page = $controller->$action(); $title = $page['title'];
If I var_dump $action or $controller, I get “NULL.” I don’t think the problem is with the code, exactly, because it did work before. But I’m not sure what’s causing the problem. Can anyone help?