For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > August 2004 > Re: [SMARTY] $smarty and variables









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] $smarty and variables
Daniel Cummings

2004-08-17, 3:59 pm

On 8/17/04 10:42 AM, "Marcus Bointon" <marcus@synchromedia.co.uk> wrote:

> I'm writing a plugin that needs to check if a particular template variable
> is defined. I can't see anything in the docs to let me find that out - is
> there a public property like a $smarty.vars array that contains all the vars
> passed to a template?? I want to be able to do something like:
>
> If (array_key_exists('myvar', $smarty.vars)) {...
>
> Marcus


It looks like:

http://smarty.php.net/manual/en/cha...ing.console.php

might have what you need. Take a look at the debug.tpl file to see how to
view all template vars.

cheers,
dan
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com