Hi,
I started developing sort of a mvc framweork on PHP5.3.0 for the static keyword, but since I'm here I said I should take advantage of the namespaces as well.
So I have something like this for the view:
namespace view
{
function load($filepath)
{
include($filepath);
}
function helper()
{
echo 'lorem ipsum';
}
}
view\load('view.php');
Now let's say my view.php looks like this:
<?= helper() ?>
It does not work, becuase the included file is for some reason in the global namespace, so I'd had to write view\helper() inside the view, which kind of defeats the purpose.
Do you have any idea how to accomplish this? Pretty much what the question title is, to include a file within the same namespace where the including is taking place.
Please note that I don't need solutions for this EXACT code scenario, it was simplified for you to understand my problem.
Thanks!