Hello.
The title is a little confusing, but:
What I am trying to do is build a simple CMS where all requests are routed through the root index.php file.
This file will be where all constants are defined and importantly where the database connection is estabilished.
There will be a folder where template files will reside and, based on the URI, a template file will be included into the root index.php file.
Here's some code:
<?php
//Sets the database connection and defines some constants
require ( "includes/config.php" );
//Where I will place the core functions of the CMS, one being the navigation builder
require ( "includes/functions.php" );
//Home page template file
require ( "views/cms/index.php" );
?>
So as you can see, I want to be able to call the navigation builder function, called "getMenuItems();", from the home page template.
However, I get the following error:
Fatal error: Call to undefined function getMenuItems() in C:\wamp\www\cms\views\cms\index.php on line 3
How can I access functions that have been defined in the "includes/functions.php" file, from the required template file "views/cms/index.php"?
If you need anything else explaining then please ask. If this has already been posted, I apologise in advance! I have searched Google and the forums but nothing turned up.
Chris