My solution is a hybrid of the above; plus some symbolic links to get the file you create to run in the directory where you want it.
Instructions:
- For the purpose of these instructions / = docroot /test = directory where we are getting the headers to work
- copy /index.php (the vb index.php) to /test and rename to vbheader.php
- copy /index.php (the vb index.php) to /test and rename to vbfooter.php
- in vbfooter comment out the line:
PHP Code:
$app = vB5_Frontend_Application::init('config.php')
- in vbfooter and vheader comment out:
PHP Code:
if ($class == 'vB5_Frontend_Controller_Main')
{
call_user_func_array(array(&$c, 'index'), array($controller, $method, $routing->getArguments()));
}
else
{
call_user_func_array(array(&$c, $method), $routing->getArguments());
}
- in vbfooter add the following at the bottom
PHP Code:
$templater = new vB5_Template('footer');
$footer = $templater->render();
echo $footer;
- in vbheader add the following at the bottom
PHP Code:
$templater = new vB5_Template('preheader');
$preheader = $templater->render();
echo $preheader;
$templater = new vB5_Template('header');
$header = $templater->render();
echo $header;
- soft link config.php, includes and core; in /test execute:
PHP Code:
ln -s../core core
ln -s ../includes includes
ln -s ../config.php config.php
- create /test/test.php as follows
PHP Code:
<?
include_once("vbhead.php");
// YOUR PHP CODE HERE
include_once("vbfooter.php");
?>
NOTE: Your menu bar at the top will ALWAYS remain as home. There is a work-around for this that have working, le me know if interested.