I'm having the following problem, I'm using an MVC template for a CMS in PHP study, however I'd like it to be possible to use themes, so I've created a configuration variable that stores the theme name for test , and when I use my controller to call my view , it looks like this:
$this->render('view_posts', $parametros);
In this function I pass the view that I'm going to use and vector $parametros
, which contains page title, description, content, etc. My render () function looks like this:
private function render($view, $parametros)
{
require_once(_APP_ROOT . '/view/' . $view.'.php');
}
If I try to get the $parametros
vector in view_posts.php
it works without problems, but as I said I wanted it to support themes, then in view_posts.php
I have require_once
with the theme name and corresponding page .
require_once(_APP_ROOT . '/tema/' . _TESTE_TEMA . 'index_view.php');
And in index_view.php
of my theme it does not recognize the $parametros
vector.
How can I solve this problem? I think it's an easy problem to solve but I'm already a bit blind on this project and can not find a solution.
One detail I'd like to cite is that I'm not using any framework , and I also do not want to use because it's a study CMS.