[eluser]Unknown[/eluser]
Hello,
I'm currently trying to install my application (which works fine in local) on olympe-network but I have an issue with my views.
I followed that tutorial (
http://code.tutsplus.com/tutorials/an-in...-net-25648) so I have this library :
libraries/Template.php :
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Template
{
var $ci;
function __construct()
{
$this->ci =& get_instance();
}
function load($tpl_view, $body_view = null, $data = null)
{
if ( ! is_null( $body_view ) )
{
if ( file_exists( APPPATH.'views/'.$tpl_view.'/'.$body_view ) )
{
$body_view_path = $tpl_view.'/'.$body_view;
}
else if ( file_exists( APPPATH.'views/'.$tpl_view.'/'.$body_view.'.php' ) )
{
$body_view_path = $tpl_view.'/'.$body_view.'.php';
}
else if ( file_exists( APPPATH.'views/'.$body_view ) )
{
$body_view_path = $body_view;
}
else if ( file_exists( APPPATH.'views/'.$body_view.'.php' ) )
{
$body_view_path = $body_view.'.php';
}
else
{
show_error('Unable to load the requested file: ' . $tpl_name.'/'.$view_name.'.php');
}
$body = $this->ci->load->view($body_view_path, $data, TRUE);
if ( is_null($data) )
{
$data = array('body' => $body);
}
else if ( is_array($data) )
{
$data['body'] = $body;
}
else if ( is_object($data) )
{
$data->body = $body;
}
}
$this->ci->load->view('templates/'.$tpl_view, $data);
}
}
And when I load my application, I get this error :
Unable to load the requested file: templates/default
Concerned file :
Controller/auth
ION auth)
Code:
function login()
{
[...]
$this->data['identity'] = array('name' => 'identity',
'id' => 'identity',
'type' => 'text',
'value' => $this->form_validation->set_value('identity'),
);
$this->data['password'] = array('name' => 'password',
'id' => 'password',
'type' => 'password',
);
$this->template->load('default', 'auth/login', $this->data); //doesn't work (using the template)
//$this->_render_page('auth/login', $this->data); //doesn't work (comes from ION auth)
}
}
templates/default :
Code:
<!DOCTYPE html>
<html>
<head>
<title><?php echo $title; ?></title>
<meta name="viewport" c initial-scale=1.0">
<meta charset="utf-8" />
<!-- Bootstrap -->
<link href="<?php echo base_url('assets/css/bootstrap.min.css'); ?>" rel="stylesheet">
<link href="<?php echo base_url('assets/css/style.css'); ?>" rel="stylesheet">
[removed][removed]
</head>
<body>
<!-- Wrap all page content here -->
<div id="wrap">
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
// navbar
</div>
<div class="container">
<div class="row">
<div class="col-md-3">
//menu
</div>
<div class="col-md-9">
<div class="page-header">
<h1><?php echo $title; echo (isset($subtitle)? ' <small>'.$subtitle.'</small>' : ''); ?></h1>
</div>
<div class="wrapper">
<?php echo $body; ?>
</div>
</div>
</div>
</div>
</div
</div>
<div id="footer">
<div class="container">
</div>
</div>
[removed][removed]
[removed][removed]
</body>
</html>
In case it could be related to htaccess :
Code:
RewriteEngine on
RewriteBase /appliname/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|js|img|css|captcha|robots\.txt)
RewriteRule ^(.*)$ /appliname/index.php/$1 [L]
It works if I don't use the template but :
$this->load->view('coming_soon', $this->data); //really basic view
I don't understand at all why it works in local but not on olympe, any idea ?
Thanks.