[eluser]kristapsv[/eluser]
Hi, first of all thank you for the smarty CI integration, but I have some trouble putting it together with Phil Sturgeon's template library.
The problem is that in layout file the php code gets executed, but in view file only smarty code.
I want that in all view and layout files only smarty language code gets executed.
Codeigniter 2.0.2
Ci-Smarty
Phil Sturgeon's template library
I have 1 controller, 1 layout and 1 view file
Controller:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends MY_Controller {
public function index()
{
$this->template->title('test');
$this->template->set_layout('default.tpl','main')->build('main/home.tpl');
}
}
/* End of file home.php */
/* Location: ./application/controllers/home.php */
layout file default.tpl
Code:
<!DOCTYPE html>
<html><?php die('This shoudnt happen'); ?>
<head>
<title>{$template.title}</title>
{$template.metadata}
</head>
<body>
<h1>{$template.title}</h1>
{$template.body}
</body>
</html>
view file home.tpl
Code:
{assign var=foo value='baa'}{$foo}<?php echo 'PHP is ingored here'; ?>
Template library config:
parser_enabled = TRUE
parser_body_enabled = TRUE
May I shoudn't use then layout feature in template library as Smarty provide capabilities for layouts via template inheritance anyway ?