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

#11
[eluser]Avatar[/eluser]
I've created a thread which utilizes this lib and the modular extensions lib along with it, located here:

http://ellislab.com/forums/viewthread/73367/

#12
[eluser]Avatar[/eluser]
Just incase anyone has this problem with javascript in the templates you can add the below to your smarty_parser.php config file:

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

#13
[eluser]Avatar[/eluser]
added function to smarty_parser.php
Code:
function template_exists($template)
    {
        if ($template == '')
        {
            return FALSE;
        }
        return parent::template_exists($template);
    }

#14
[eluser]kenjis[/eluser]
Hi!

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

http://codeigniter.com/wiki/Smarty/

Thank you for good Smarty integration code.

#15
[eluser]donpepito[/eluser]
Hi!

How can I disable caching?

I set the
Code:
$config['caching']
variable to 0 in application/config/Smarty_parser.php.

I also tried to set it in the controller:

Code:
$this->smarty_parser->caching = 0;

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

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

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

I can't see the changes.

Thank you for your help!

#16
[eluser]Unknown[/eluser]
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 ?

Thanks,
Chris

Quote:--Problems Solved--

The "INI" means that php.ini file.

#17
[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

Thanks.

#18
[eluser]dmitrybelyakov[/eluser]
[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

Thanks.[/quote]

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

#19
[eluser]dmitrybelyakov[/eluser]
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

#20
[eluser]Jagar[/eluser]
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"?

Thanks


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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