Integrate Smarty and Module Extend in CodeIgniter

611 Views Asked by At

I am new with smarty framework. I want to make a project that have integration smarty and module extend(MX) with CodeIgniter. I can integrate but not response to what i want.

my result is work only template file in "ApplicationFolder/ModulesFolder/Views/MyTemplateFile.tpl" when I run my Controller in my Module. But what I want is it can work in "ApplicationFolder/Views/MyTemplateFile" is rather than My Module.

I use $this->parser->parse("views/MyTemplateFile.tpl",$data) in my controller it show empty page.

thank you first for anyone can help me.

1

There are 1 best solutions below

0
On

this one should work https://github.com/Vheissu/Ci-Smarty

at development environment, it trigger notice error, so i change this file APPPATH/libraries/MY_Parser.php to extends MX_Loader, and change $_module modifier to 'protected' instead of 'private' and everything work fine

class MY_Parser extends MX_Loader {

protected $CI;
protected $theme_location;

protected $_module = '';

/* .... */
}