CodeIgniter is executed from within index.php
script and paths of require
function are resolved based on index.php
path. For example if you would put test.php
in CodeIgniter root folder and then you would call require './test.php'
from your controller then the test.php
would be included without a problem.
To answer the question we need php magic constant __DIR__
which is always set to current script folder. The answer is:
require __DIR__."/../base.php";
called from within home.php
.
Edit: And platform independent solution would be:
require __DIR__.DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."base.php";