[SOLVED]Smarty function getTemplateVars() does not work

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Locked
User avatar
quadracer
Forum Members
Forum Members
Posts: 44
Joined: Wed Apr 26, 2006 9:59 am

[SOLVED]Smarty function getTemplateVars() does not work

Post by quadracer »

Hi,

I'm trying to get access to a Smarty variable like documented here

http://www.smarty.net/docs/en/api.get.template.vars.tpl

with

Code: Select all

$myVar = $smarty->getTemplateVars('foo');
I'm using a fresh 1.9.1 install. But I got only an error message
Fatal error: Call to undefined method Smarty_CMS::getTemplateVars()
Any ideas?
Last edited by quadracer on Tue Nov 30, 2010 7:05 pm, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Smarty function getTemplateVars() does not work

Post by RonnyK »

In CMSMS you could use {get_template_vars}

Ronny
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Smarty function getTemplateVars() does not work

Post by Wishbone »

He means the PHP function, not the template function.

Try $smarty->get_template_vars('foo');
Last edited by Wishbone on Tue Nov 30, 2010 3:05 pm, edited 1 time in total.
User avatar
quadracer
Forum Members
Forum Members
Posts: 44
Joined: Wed Apr 26, 2006 9:59 am

Re: Smarty function getTemplateVars() does not work

Post by quadracer »

Thank you @RonnyK and @wishbone,

was my fault. Smarty docs are updated for current Smarty version ... and this is version 3.0.5  8).

The correct url for Smarty 2 is

http://www.smarty.net/docsv2/en/api.get ... e.vars.tpl
Locked

Return to “Developers Discussion”