Vheissu / Ci-Smarty

Smarty templating engine integration for Codeigniter 3.0+ with inbuilt theming and asset management.
http://ilikekillnerds.com
179 stars 43 forks source link

Bug in My_Parser #7

Closed Koles100 closed 13 years ago

Koles100 commented 13 years ago

in line 49 should be $data = array_merge($data, $this->CI->load->_ci_cached_vars); instead of $data = array_merge($data, $this->load->_ci_cached_vars);

nakp commented 13 years ago

yes you're right! I'll push new changes rigth away, thank you!

schir1964 commented 13 years ago

I also had to correct this bug.

Also, I made the following modifications to make this work as described in the installation instructions. CodeIgniter 2.0.2 Smarty 3.0.7

MY_Parser (Library): Added the following line above the class definition - require_once BASEPATH . "libraries/Parser.php";

smartytest.php (Controller): Replaced all references of parser with my_parser to access library above.

Once i did this the test code worked flawlessly.

Great work!

nakp commented 13 years ago

actually it's not a bug, it's the way CodeIgniter is supposed to work, all you have to do is load the parser and CI will load parser class (and my_parser if exists) into $this->parser, there's no need to requiere anything either

http://codeigniter.com/user_guide/general/core_classes.html

Read at "Extending Core Class"

schir1964 commented 13 years ago

Odd, for some reason, MY_Parser isn't getting loaded automatically with that configuration. I'll see what I can find out. Of course I just started with CodeIgniter three days ago so it's possible I may have mucked something up.

schir1964 commented 13 years ago

Okay, I just reloaded codeigniter from scratch and changed just those parameters necessary to get it working.

I then followed the installation instructions for Vheissu's smarty code verbatim (changed autoload libraries as suggested) and although the template file is being loaded, the smarty variables are not being replaced.

I'm using: CodeIgniter 2.0.2 Smarty 3.0.7

So would this be a configuration issue for Smarty or CodeIgniter? Any suggestions would be appreciated. Thanks.

schir1964 commented 13 years ago

Alright, I figured out what I did wrong. I didn't follow the instructions explicitly.

I was putting the MY_Parser.php and Smarty.php into the system/libraries instead of the application/libraries.

Nevermind.

Vheissu commented 13 years ago

Changes pushed and working :)