How to change directory when using a classtemplate
Posted: Mon Sep 26, 2016 10:29 am
Hello again,
I use a class to help me with the layout of my homepage. To the left I have buttons that redirect to various php script (pages). Those are displayed in the main column on my page.
The mainpage class is stored in Framework_Lib.php and before I had all the pages in the same folder as Framework_Lib.php and it all worked fine.
The problem is there are so many files now so I wanted to move the pages the buttons point to to a subfolder called Leftmenu.
Now it only works the first time I click a button but after that all the links are broken since i jump from /Main folder (where the class is stored) to /Main/Leftmenu/
The way the page is setup is i make an array with the buttons and the url like $buttons = array ("Show Users" => "/../Main/Leftmenu/users.php");
In users I use
ob_start();
Code here
$content=ob_get_contents();
ob_end_clean();
$homepage->content = $content;
$homepage->Display();
So it all works fine when all the content is in the same folder but as soon as i put stuff in another folder it ofcourse breaks since my button array redirect to another folder.. but is there a way to get back to redirect back to the Main folder from the users.php page?
I use a class to help me with the layout of my homepage. To the left I have buttons that redirect to various php script (pages). Those are displayed in the main column on my page.
The mainpage class is stored in Framework_Lib.php and before I had all the pages in the same folder as Framework_Lib.php and it all worked fine.
The problem is there are so many files now so I wanted to move the pages the buttons point to to a subfolder called Leftmenu.
Now it only works the first time I click a button but after that all the links are broken since i jump from /Main folder (where the class is stored) to /Main/Leftmenu/
The way the page is setup is i make an array with the buttons and the url like $buttons = array ("Show Users" => "/../Main/Leftmenu/users.php");
In users I use
ob_start();
Code here
$content=ob_get_contents();
ob_end_clean();
$homepage->content = $content;
$homepage->Display();
So it all works fine when all the content is in the same folder but as soon as i put stuff in another folder it ofcourse breaks since my button array redirect to another folder.. but is there a way to get back to redirect back to the Main folder from the users.php page?