What is _VIEW_PATH_ in require_once? _

0

I was practicing examples in php and I found this example of require_once, but it generated doubts for me that it is _VIEW_PATH_:

  public function index() {
            $model = $this->empleado->listar();

            require_once _VIEW_PATH_ . 'header.php';
            require_once _VIEW_PATH_ .'home/index.php';
            require_once _VIEW_PATH_ . 'footer.php';
        }  

I hope someone can help me, I appreciate it.

    
asked by isgb 23.09.2017 в 23:27
source

2 answers

0

What you are doing is concatenating the path of the folder where the views are with the name of the module. If you try to print the value, you will see how a route returns to you:

echo _VIEW_PATH_ . 'header.php'; // ruta del archivo completo.

And you will surely know what to do required_once .

    
answered by 23.09.2017 / 23:38
source
0

Use this form:

require_once('header.php');
require_once('home/index.php');
require_once('footer.php');
    
answered by 24.09.2017 в 02:53