• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Yet Another Smarty Thread

I've created a thread which utilizes this lib and the modular extensions lib along with it, located here:


Just incase anyone has this problem with javascript in the templates you can add the below to your smarty_parser.php config file:

$config['left_delimiter'] = '<!--{';
$config['right_delimiter'] = '}-->';
or use:

added function to smarty_parser.php
function template_exists($template)
        if ($template == '')
            return FALSE;
        return parent::template_exists($template);


I've just made zip file of the code in this thread,
and put it in WIKI for convenience.


Thank you for good Smarty integration code.


How can I disable caching?

I set the
variable to 0 in application/config/Smarty_parser.php.

I also tried to set it in the controller:

$this->smarty_parser->caching = 0;

If I modify the
$data["smarty_test"] = "smarty var test";
variable, I don't see the changes.

-- update --
Smarty is ok now, but CI caches the data.

$data["ci_var"] = "test msg";
$this->smarty_parser->parse("ci:testpage.tpl", $data);

I can't see the changes.

Thank you for your help!

Hi, I have followed the detailed instructions written in this thread. But an error occurred:

Quote:Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in C:\www\smartci\application\libraries\Smarty_parser.php on line 83

I am using CodeIgniter 1.6.13. Could anybody please help ?


Quote:--Problems Solved--

The "INI" means that php.ini file.

[eluser]Milos Dakic[/eluser]
Is it somehow possible to make is so that the class 'Smarty_parser' is called within CI as $this->smarty->whatever from the now $this->smarty_parser->whatever


[quote author="Milos Dakic" date="1219330111"]Is it somehow possible to make is so that the class 'Smarty_parser' is called within CI as $this->smarty->whatever from the now $this->smarty_parser->whatever


No as the Smarty_parser class is actually a wrapper for Smarty class itself.

I wonder if there's a way to tell Smarty to parse templates located in a place other then application/view folder.
For example: if you use Modular Extensions, each module has its own Views folder located under application/modules/module_name/views. Maybe there's a way to pass full path to view file aling with it's name....

Any thoughts on the topic will be higly appreciated Smile

Excellent Work, this is what I needed.

I've been searching since yesterday and this is the best one that I've found.

What is the purpose of the second parameter "$data"?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.