⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Simplicity project not working on remote server



simplicity_user

simplicity_user
  • profile picture
  • Member

Posted 05 May 2015 - 04:47 AM

I have a Simplicity project that runs fine locally and I'm trying to get it running on my remote server (CPanel hosted by Godaddy). The problem is that I am just getting the view displaying without the theme. To make this clearer, if I had the following as my theme: (views/themes/default.php):
 
<!DOCTYPE html>
<html lang="en">
<head>
<title>My title</title>
</head>
<body>
<?php echo $output;?>
</body>
</html>
 
And the following as my view (views/pages/home.php):
 
<p>My content</p>
 
The following would be rendered in the browser:
 
<p>My content</p>
 
So, I have this in my controller:
 
public function index() {
...
     $this->output->set_template('default');
...
        $this->load->view('pages/home');
    }
 
And have found that that the Simplicity class MY_Output _display method is run but it seems the core CI_Output _display method isn't (even though I haven't changed the overriding method or any other Simplicity methods and core methods and it works fine locally), so it's just rendering the view.
 
Any ideas about why this might be? Thanks!
 
PS. My directory structure is the same as locally:
 
- application
- assets
- system
- .htaccess
- index.php
 
And my .htaccess file looks like this:
 
RewriteEngine On 
RewriteBase /
RewriteCond $1 !^(index\.php|assets|images|js|css|uploads|favicon.png)
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L]
 
I'm also getting a PHP (from a require in the home.php view):
 
require(/../partials/footer.php): failed to open stream: No such file or directory

 


simplicity_user

simplicity_user
  • profile picture
  • Member

Posted 06 May 2015 - 04:13 AM

I've tracked it down to an issue with not finding the footer partial so this prevented the wrapping html from being rendered. I changed it to:

require APPPATH.'views/partials/footer.php'; 

And it renders fine now.

 

Thanks anyway. :)