[eluser]CroNiX[/eluser]
Just use the built in APPPATH constant (defined at the bottom of index.php and is what CI uses internally), which is a full path that points to
/your/install/application/
So just
Code:
if ( ! file_exists(APPPATH . 'views/pages/' . $page . '.php')) {
No need to recreate something that is already there, and it won't matter if you've relocated the application dir.